Advertisement
lafur

Untitled

Jan 28th, 2019
244
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. --https://github.com/Mokiros/roblox-FE-compatibility
  2. if game:GetService("RunService"):IsClient() then error("Script must be server-side in order to work; use h/ and not hl/") end
  3. local Player,game,owner = owner,game
  4. local RealPlayer = Player
  5. do print("FE Compatibility code V2 by Mokiros")local RealPlayer=RealPlayer;script.Parent=RealPlayer.Character;local a=function(b)b[1].f[b[2]]=nil end;local c={__index={disconnect=a,Disconnect=a}}local d={__index={Connect=function(b,e)local f=tostring(math.random(0,10000))while b.f[f]do f=tostring(math.random(0,10000))end;b.f[f]=e;return setmetatable({b,f},c)end}}d.__index.connect=d.__index.Connect;local function g()return setmetatable({f={}},d)end;local h={Hit=CFrame.new(),KeyUp=g(),KeyDown=g(),Button1Up=g(),Button1Down=g(),Button2Up=g(),Button2Down=g()}h.keyUp=h.KeyUp;h.keyDown=h.KeyDown;local i={InputBegan=g(),InputEnded=g()}local CAS={Actions={},BindAction=function(self,j,k,l,...)CAS.Actions[j]=k and{Name=j,Function=k,Keys={...}}or nil end}CAS.UnbindAction=CAS.BindAction;local function m(self,n,...)for o,e in pairs(self[n].f)do e(...)end end;h.T=m;i.T=m;local p=Instance.new("RemoteEvent")p.Name="UserInput_Event"p.OnServerEvent:Connect(function(q,r)if q~=RealPlayer then return end;h.Target=r.e;h.Hit=r.d;if not r.f then local s=r.c==Enum.UserInputState.Begin;if r.b==Enum.UserInputType.MouseButton1 then return h:T(s and"Button1Down"or"Button1Up")end;if r.b==Enum.UserInputType.MouseButton2 then return h:T(s and"Button2Down"or"Button2Up")end;for o,t in pairs(CAS.Actions)do for o,u in pairs(t.Keys)do if u==r.a then t.Function(t.Name,r.c,r)end end end;h:T(s and"KeyDown"or"KeyUp",r.a.Name:lower())i:T(s and"InputBegan"or"InputEnded",r,false)end end)p.Parent=NLS([==[local a=script:WaitForChild("UserInput_Event")local b=owner:GetMouse()local c=game:GetService("UserInputService")local d=function(e,f)if f then return end;a:FireServer({a=e.KeyCode,b=e.UserInputType,c=e.UserInputState,d=b.Hit,e=b.Target})end;c.InputBegan:Connect(d)c.InputEnded:Connect(d)local g,h;local i=game:GetService("RunService").Heartbeat;while true do if g~=b.Hit or h~=b.Target then g,h=b.Hit,b.Target;a:FireServer({f=1,Target=h,d=g})end;for j=1,2 do i:Wait()end end]==],script)local v=game;local w={__index=function(self,u)local x=rawget(self,"_RealService")if x then return typeof(x[u])=="function"and function(o,...)return x[u](x,...)end or x[u]end end,__newindex=function(self,u,y)local x=rawget(self,"_RealService")if x then x[u]=y end end}local function z(t,A)t._RealService=typeof(A)=="string"and v:GetService(A)or A;return setmetatable(t,w)end;local B={GetService=function(self,x)return rawget(self,x)or v:GetService(x)end,Players=z({LocalPlayer=z({GetMouse=function(self)return h end},Player)},"Players"),UserInputService=z(i,"UserInputService"),ContextActionService=z(CAS,"ContextActionService"),RunService=z({_btrs={},RenderStepped=v:GetService("RunService").Heartbeat,BindToRenderStep=function(self,j,o,k)self._btrs[j]=self.Heartbeat:Connect(k)end,UnbindFromRenderStep=function(self,j)self._btrs[j]:Disconnect()end},"RunService")}rawset(B.Players,"localPlayer",B.Players.LocalPlayer)B.service=B.GetService;z(B,game)game,owner=B,B.Players.LocalPlayer end --Converted with ttyyuu12345's model to script plugin v4
  6. function sandbox(var,func)
  7. local env = getfenv(func)
  8. local newenv = setmetatable({},{
  9. __index = function(self,k)
  10. if k=="script" then
  11. return var
  12. else
  13. return env[k]
  14. end
  15. end,
  16. })
  17. setfenv(func,newenv)
  18. return func
  19. end
  20. cors = {}
  21. mas = Instance.new("Model",game:GetService("Lighting"))
  22. Tool0 = Instance.new("Tool")
  23. Part1 = Instance.new("Part")
  24. Sound2 = Instance.new("Sound")
  25. SpecialMesh3 = Instance.new("SpecialMesh")
  26. Script4 = Instance.new("Script")
  27. LocalScript5 = Instance.new("LocalScript")
  28. Script6 = Instance.new("Script")
  29. Configuration7 = Instance.new("Configuration")
  30. BoolValue8 = Instance.new("BoolValue")
  31. Configuration9 = Instance.new("Configuration")
  32. NumberValue10 = Instance.new("NumberValue")
  33. NumberValue11 = Instance.new("NumberValue")
  34. StringValue12 = Instance.new("StringValue")
  35. BoolValue13 = Instance.new("BoolValue")
  36. BoolValue14 = Instance.new("BoolValue")
  37. StringValue15 = Instance.new("StringValue")
  38. ObjectValue16 = Instance.new("ObjectValue")
  39. Tool0.Name = "Trap"
  40. Tool0.Parent = mas
  41. Tool0.GripForward = Vector3.new(-0, 1, -0)
  42. Tool0.GripPos = Vector3.new(0, -0.550000012, -0.649999976)
  43. Tool0.GripUp = Vector3.new(0, 0, 1)
  44. Part1.Name = "Handle"
  45. Part1.Parent = Tool0
  46. Part1.Rotation = Vector3.new(-90, 0, -90)
  47. Part1.FormFactor = Enum.FormFactor.Plate
  48. Part1.Size = Vector3.new(1, 3.60000014, 1)
  49. Part1.CFrame = CFrame.new(13.1099844, 25.6800003, 865.159973, 0, 1, 0, 0, 0, 1, 1, 0, 0)
  50. Part1.BottomSurface = Enum.SurfaceType.Smooth
  51. Part1.TopSurface = Enum.SurfaceType.Smooth
  52. Part1.Position = Vector3.new(13.1099844, 25.6800003, 865.159973)
  53. Part1.Orientation = Vector3.new(-90, -90, 0)
  54. Sound2.Name = "EquipSound"
  55. Sound2.Parent = Part1
  56. Sound2.SoundId = "http://www.roblox.com/asset/?id=10756118"
  57. SpecialMesh3.Parent = Part1
  58. SpecialMesh3.MeshId = "http://www.roblox.com/asset/?id=11915746"
  59. SpecialMesh3.TextureId = "http://www.roblox.com/asset/?id=87812844"
  60. SpecialMesh3.MeshType = Enum.MeshType.FileMesh
  61. Script4.Name = "RayGun"
  62. Script4.Parent = Tool0
  63. table.insert(cors,sandbox(Script4,function()
  64. local Tool = script.Parent;
  65.  
  66. enabled = true
  67.  
  68. local spark = Instance.new("Sparkles")
  69.  
  70. function fire(v)
  71.  
  72.  
  73.  
  74.  
  75.  
  76.  
  77.  
  78.  
  79.  
  80. local vCharacter = Tool.Parent
  81. local vPlayer = game.Players:playerFromCharacter(vCharacter)
  82.  
  83. local missile = Instance.new("Part")
  84.  
  85. local spawnPos = vCharacter.PrimaryPart.Position
  86.  
  87. local PewPew = Tool.Handle:FindFirstChild("PewPew")
  88.  
  89. if (PewPew == nil) then
  90. PewPew = Instance.new("Sound")
  91. PewPew.Name = "PewPew"
  92. PewPew.SoundId = "http://www.roblox.com/asset/?id=11944350"
  93. PewPew.Parent = Tool.Handle
  94. PewPew.Volume = 1
  95. end
  96.  
  97.  
  98. spawnPos = spawnPos + (v * 10)
  99.  
  100.  
  101. missile.Position = spawnPos
  102. missile.Size = Vector3.new(40,40,40)
  103. missile.Velocity = v * 200
  104. missile.BrickColor = BrickColor.new("Lime green")
  105. missile.Shape = 2
  106. missile.Transparency = script.Parent.Settings.Transperancy.Value
  107. missile.BottomSurface = 0
  108. missile.TopSurface = 0
  109. missile.Name = script.Parent.Settings.Name
  110. missile.Reflectance = script.Parent.Settings.Reflect.Value
  111. missile.CanCollide = script.Parent.Settings.Collide.Value
  112. missile.Material = script.Parent.Settings.Materializer.Value
  113. missile.Locked = script.Parent.Settings.Locked.Value
  114. missile.Anchored = script.Parent.BreakSpark.Anchor.Value
  115.  
  116.  
  117. spark:Clone().Parent = missile
  118. spark.Color = missile.Color
  119.  
  120.  
  121. local force = Instance.new("BodyForce")
  122. force.force = Vector3.new(0,100,0)
  123. force.Parent = missile
  124.  
  125. local creator_tag = Instance.new("ObjectValue")
  126. creator_tag.Value = vPlayer
  127. creator_tag.Name = "creator"
  128. creator_tag.Parent = missile
  129.  
  130. local new_script = script.Parent.LaserBlast:clone()
  131. new_script.Disabled = false
  132. new_script.Parent = missile
  133.  
  134. missile.Parent = game.Workspace
  135.  
  136. PewPew:Play()
  137.  
  138. end
  139.  
  140.  
  141.  
  142. function gunUp()
  143. Tool.GripForward = Vector3.new(0,.981,-.196)
  144. Tool.GripRight = Vector3.new(1,0,0)
  145. Tool.GripUp = Vector3.new(0,.196,.981)
  146. end
  147.  
  148. function gunOut()
  149. Tool.GripForward = Vector3.new(0,1,0)
  150. Tool.GripRight = Vector3.new(1,0,0)
  151. Tool.GripUp = Vector3.new(0,0,1)
  152. end
  153.  
  154. function isTurbo(character)
  155. return character:FindFirstChild("BoltHelm") ~= nil
  156. end
  157.  
  158.  
  159. function onActivated()
  160. if not enabled then
  161. return
  162. end
  163.  
  164. enabled = false
  165.  
  166.  
  167. local character = Tool.Parent;
  168. local humanoid = character.Humanoid
  169. if humanoid == nil then
  170. print("Humanoid not found")
  171. return
  172. end
  173.  
  174. local targetPos = humanoid.TargetPoint
  175. local lookAt = (targetPos - character.Head.Position).unit
  176.  
  177. local reload = 1
  178. --if (isTurbo(character)) then
  179. -- reload = .25
  180. -- print("turbo")
  181. --end
  182.  
  183. gunUp()
  184. fire(lookAt)
  185. wait(reload)
  186. gunOut()
  187. wait(reload)
  188.  
  189. enabled = true
  190.  
  191. end
  192.  
  193. function onEquipped()
  194. Tool.Handle.EquipSound:play()
  195. end
  196.  
  197. script.Parent.Activated:connect(onActivated)
  198. script.Parent.Equipped:connect(onEquipped)
  199.  
  200. end))
  201. LocalScript5.Name = "Local Gui"
  202. LocalScript5.Parent = Tool0
  203. table.insert(cors,sandbox(LocalScript5,function()
  204. local Tool = script.Parent;
  205.  
  206. enabled = true
  207. function onButton1Down(mouse)
  208. if not enabled then
  209. return
  210. end
  211.  
  212. enabled = false
  213. mouse.Icon = "rbxasset://textures\\GunWaitCursor.png"
  214.  
  215. wait(1)
  216. mouse.Icon = "rbxasset://textures\\GunCursor.png"
  217. enabled = true
  218.  
  219. end
  220.  
  221. function onEquippedLocal(mouse)
  222.  
  223. if mouse == nil then
  224. print("Mouse not found")
  225. return
  226. end
  227.  
  228. mouse.Icon = "rbxasset://textures\\GunCursor.png"
  229. mouse.Button1Down:connect(function() onButton1Down(mouse) end)
  230. end
  231.  
  232.  
  233. Tool.Equipped:connect(onEquippedLocal)
  234.  
  235. end))
  236. Script6.Name = "LaserBlast"
  237. Script6.Parent = Tool0
  238. Script6.Disabled = true
  239. table.insert(cors,sandbox(Script6,function()
  240. ball = script.Parent
  241. damage = 9000
  242.  
  243. HitSound = Instance.new("Sound")
  244. HitSound.Name = "HitSound"
  245. HitSound.SoundId = "http://www.roblox.com/asset/?id=11945266"
  246. HitSound.Parent = ball
  247. HitSound.Volume = 1
  248.  
  249.  
  250.  
  251. function onTouched(hit)
  252. local humanoid = hit.Parent:findFirstChild("Humanoid")
  253.  
  254. if humanoid ~= nil then
  255. tagHumanoid(humanoid)
  256. humanoid:TakeDamage(damage)
  257. plyr = ball:findFirstChild("creator").Value
  258. plyr.leaderstats.Points.Value = plyr.leaderstats.Points.Value + 4
  259. wait(0.2)
  260. untagHumanoid(humanoid)
  261. end
  262.  
  263. HitSound:Play()
  264. ball.Parent = nil
  265.  
  266. end
  267.  
  268. function tagHumanoid(humanoid)
  269. -- todo: make tag expire
  270. local tag = ball:findFirstChild("creator")
  271. if tag ~= nil then
  272. local new_tag = tag:clone()
  273. new_tag.Parent = humanoid
  274. end
  275. end
  276.  
  277.  
  278. function untagHumanoid(humanoid)
  279. if humanoid ~= nil then
  280. local tag = humanoid:findFirstChild("creator")
  281. if tag ~= nil then
  282. tag.Parent = nil
  283. end
  284. end
  285. end
  286.  
  287. connection = ball.Touched:connect(onTouched)
  288.  
  289. wait(5)
  290. script.Parent:Destroy()
  291.  
  292. --ball.SparkSound.Looped = false
  293. --ball.SparkSound:Stop()
  294. ball.Parent = nil
  295. end))
  296. Configuration7.Name = "BreakSpark"
  297. Configuration7.Parent = Tool0
  298. BoolValue8.Name = "Anchor"
  299. BoolValue8.Parent = Configuration7
  300. BoolValue8.Value = true
  301. Configuration9.Name = "Settings"
  302. Configuration9.Parent = Tool0
  303. NumberValue10.Name = "Transperancy"
  304. NumberValue10.Parent = Configuration9
  305. NumberValue10.Value = 0.5
  306. NumberValue11.Name = "Reflect"
  307. NumberValue11.Parent = Configuration9
  308. NumberValue11.Value = 0.4
  309. StringValue12.Name = "Name"
  310. StringValue12.Parent = Configuration9
  311. StringValue12.Value = "NAY"
  312. BoolValue13.Name = "Locked"
  313. BoolValue13.Parent = Configuration9
  314. BoolValue13.Value = true
  315. BoolValue14.Name = "Collide"
  316. BoolValue14.Parent = Configuration9
  317. BoolValue14.Value = true
  318. StringValue15.Name = "Materializer"
  319. StringValue15.Parent = Configuration9
  320. StringValue15.Value = "Neon"
  321. ObjectValue16.Name = "Note - This is made by Anime"
  322. ObjectValue16.Parent = Tool0
  323. for i,v in pairs(mas:GetChildren()) do
  324. v.Parent = game:GetService("Players").LocalPlayer.Backpack
  325. pcall(function() v:MakeJoints() end)
  326. end
  327. mas:Destroy()
  328. for i,v in pairs(cors) do
  329. spawn(function()
  330. pcall(v)
  331. end)
  332. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement