Advertisement
Guest User

please work

a guest
Dec 17th, 2018
118
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 8.09 KB | None | 0 0
  1. -- This script has been converted to FE by iPxter
  2.  
  3.  
  4. if game:GetService("RunService"):IsClient() then error("Script must be server-side in order to work; use h/ and not hl/") end
  5. local Player,Mouse,mouse,UserInputService,ContextActionService = owner
  6. do
  7. print("FE Compatibility code by Mokiros | Translated to FE by iPxter")
  8. script.Parent = Player.Character
  9.  
  10. --RemoteEvent for communicating
  11. local Event = Instance.new("RemoteEvent")
  12. Event.Name = "UserInput_Event"
  13.  
  14. --Fake event to make stuff like Mouse.KeyDown work
  15. local function fakeEvent()
  16. local t = {_fakeEvent=true,Connect=function(self,f)self.Function=f end}
  17. t.connect = t.Connect
  18. return t
  19. end
  20.  
  21. --Creating fake input objects with fake variables
  22. local m = {Target=nil,Hit=CFrame.new(),KeyUp=fakeEvent(),KeyDown=fakeEvent(),Button1Up=fakeEvent(),Button1Down=fakeEvent()}
  23. local UIS = {InputBegan=fakeEvent(),InputEnded=fakeEvent()}
  24. local CAS = {Actions={},BindAction=function(self,name,fun,touch,...)
  25. CAS.Actions[name] = fun and {Name=name,Function=fun,Keys={...}} or nil
  26. end}
  27. --Merged 2 functions into one by checking amount of arguments
  28. CAS.UnbindAction = CAS.BindAction
  29.  
  30. --This function will trigger the events that have been :Connect()'ed
  31. local function te(self,ev,...)
  32. local t = m[ev]
  33. if t and t._fakeEvent and t.Function then
  34. t.Function(...)
  35. end
  36. end
  37. m.TrigEvent = te
  38. UIS.TrigEvent = te
  39.  
  40. Event.OnServerEvent:Connect(function(plr,io)
  41. if plr~=Player then return end
  42. if io.isMouse then
  43. m.Target = io.Target
  44. m.Hit = io.Hit
  45. else
  46. local b = io.UserInputState == Enum.UserInputState.Begin
  47. if io.UserInputType == Enum.UserInputType.MouseButton1 then
  48. return m:TrigEvent(b and "Button1Down" or "Button1Up")
  49. end
  50. for _,t in pairs(CAS.Actions) do
  51. for _,k in pairs(t.Keys) do
  52. if k==io.KeyCode then
  53. t.Function(t.Name,io.UserInputState,io)
  54. end
  55. end
  56. end
  57. m:TrigEvent(b and "KeyDown" or "KeyUp",io.KeyCode.Name:lower())
  58. UIS:TrigEvent(b and "InputBegan" or "InputEnded",io,false)
  59. end
  60. end)
  61. Event.Parent = NLS([==[
  62. local Player = game:GetService("Players").LocalPlayer
  63. local Event = script:WaitForChild("UserInput_Event")
  64.  
  65. local UIS = game:GetService("UserInputService")
  66. local input = function(io,a)
  67. if a then return end
  68. --Since InputObject is a client-side instance, we create and pass table instead
  69. Event:FireServer({KeyCode=io.KeyCode,UserInputType=io.UserInputType,UserInputState=io.UserInputState})
  70. end
  71. UIS.InputBegan:Connect(input)
  72. UIS.InputEnded:Connect(input)
  73.  
  74. local h,t
  75. --Give the server mouse data 30 times every second, but only if the values changed
  76. --If player is not moving their mouse, client won't fire events
  77. while wait(1/30) do
  78. if h~=Mouse.Hit or t~=Mouse.Target then
  79. h,t=Mouse.Hit,Mouse.Target
  80. Event:FireServer({isMouse=true,Target=t,Hit=h})
  81. end
  82. end]==],Player.Character)
  83. Mouse,mouse,UserInputService,ContextActionService = m,m,UIS,CAS
  84. end
  85.  
  86.  
  87. ----------------------------------------
  88. -- Originally made by Alfederate :D --
  89. ----------------------------------------
  90.  
  91. -- there's no time to explain! --
  92.  
  93. local new=Instance.new
  94. local rad=math.rad
  95. local cf=CFrame.new
  96. local v3=Vector3.new
  97. local ang=function(x,y,z)
  98. return CFrame.Angles(rad(x),rad(y),rad(z))
  99. end
  100. local player= owner
  101. local char=player.Character
  102. local cam=workspace.Camera
  103. local weld=function(a,b,c0,c1)
  104. m=Instance.new('Motor',a)
  105. m.Part0=a
  106. m.Part1=b
  107. m.C0=c0
  108. m.C1=c1
  109. return m
  110. end
  111.  
  112. start='rbxassetid://592555095'
  113. snd='rbxassetid://594472043'
  114. beamm=Instance.new('Model',workspace)
  115. beamm.Name='beam'
  116.  
  117. laser=false
  118.  
  119. rs=Instance.new('Part',char)
  120. rs.Transparency=1
  121. rs.CanCollide=false
  122. rs.TopSurface,rs.BottomSurface=0,0
  123. rs.FormFactor=3
  124. rs.Size=Vector3.new(.5,.5,.5)
  125.  
  126. ls=rs:Clone()
  127. ls.Parent=char
  128.  
  129. rsw=weld(rs,char.Torso,cf(-1,-.5,0),cf())
  130. lsw=weld(ls,char.Torso,cf(1,-.5,0),cf())
  131. raw=weld(char['Right Arm'],rs,cf(-.5,.6,-.14),ang(90,0,-8))
  132. law=weld(char['Left Arm'],ls,cf(-.3,1.5,-.14),ang(90,0,43))
  133.  
  134. vol=1
  135.  
  136. s1=Instance.new('Sound',char)
  137. s1.Volume=vol
  138. s1.Pitch=1
  139. s1.Looped=true
  140. s1.SoundId=snd
  141.  
  142. s2=Instance.new('Sound',char)
  143. s2.Volume=vol
  144. s2.Pitch=1
  145. s2.Looped=true
  146. s2.SoundId=start
  147.  
  148. s2:play()
  149.  
  150. particles={}
  151.  
  152. local wep=new('Part',char)
  153. wep.FormFactor=3
  154. wep.CanCollide=false
  155. wep.Size=v3(1,3,1)
  156. wep.TopSurface,wep.BottomSurface=0,0
  157. local wepw=weld(wep,char['Right Arm'],cf(.26,.4,.7),ang(0,0,8))
  158.  
  159. local beam=wep:Clone()
  160. beam:ClearAllChildren()
  161. beam.Material='Neon'
  162. beam.BrickColor=BrickColor.new('Electric blue')
  163. beam.Size=Vector3.new(3,3,1)
  164. beam.Transparency=.5
  165. beam.Anchored=true
  166. local ms=Instance.new('BlockMesh',beam)
  167. local inner=beam:Clone()
  168. inner.Transparency=0
  169. inner.Material='SmoothPlastic'
  170. inner.BrickColor=BrickColor.new('Green')
  171. local ms2=inner.Mesh
  172.  
  173. local expl=inner:Clone()
  174. expl.Mesh:Destroy()
  175. expl.Material='Neon'
  176. expl.BrickColor=BrickColor.new('Really red')
  177. expl.Size=Vector3.new(11,11,11)
  178. expl.Transparency=.55
  179. pl=Instance.new('PointLight',expl)
  180. pl.Color=expl.BrickColor.Color
  181. pl.Range=pl.Range*2
  182. pl.Name='light'
  183. local br=pl.Range
  184.  
  185. local exa=expl:Clone()
  186. exa.Size=Vector3.new(4,4,4)
  187. pl2=exa.light
  188.  
  189. local part=exa:Clone()
  190. part.Size=Vector3.new(1.5,1.5,1.5)
  191. pl3=part.light
  192. pms=Instance.new('BlockMesh',part)
  193.  
  194. char.Humanoid.Died:connect(function()
  195. laser=false
  196. beam.Parent=nil
  197. inner.Parent=nil
  198. expl.Parent=nil
  199. exa.Parent=nil
  200. s2:stop()
  201. s1:stop()
  202. end)
  203.  
  204. mouse.Button1Down:connect(function() if char.Humanoid.Health~=0 then
  205. laser=true
  206. s1:play()
  207. s2:stop()
  208. end end)
  209. mouse.Button1Up:connect(function()
  210. laser=false
  211. beam.Parent=nil
  212. inner.Parent=nil
  213. expl.Parent=nil
  214. exa.Parent=nil
  215. s1:stop()
  216. s2:play()
  217. end)
  218.  
  219. parti=0
  220. game:service'RunService'.Stepped:connect(function()
  221. parti=parti+1
  222. for i,v in pairs(particles) do
  223. v.CFrame=v.CFrame*CFrame.new(0,0,-.3)
  224. v.Transparency=v.Transparency+.08
  225. if v.Transparency >= 1 then
  226. v:Destroy()
  227. table.remove(particles,i)
  228. else
  229. v.Parent=beamm
  230. end
  231. end
  232. a=cam.CoordinateFrame.p
  233. b=mouse.Hit.p
  234. mhitr=Ray.new(a,(b-a).unit*999)
  235. mhit,ps=workspace:FindPartOnRayWithIgnoreList(mhitr,{char,beamm})
  236. raw.C1=ang(90+(mouse.Hit.lookVector.y*90),0,-8)
  237. law.C1=ang(90+(mouse.Hit.lookVector.y*90),0,43)
  238. if not char.Humanoid.Sit and not char.Humanoid.PlatformStand then
  239. char.Torso.CFrame=CFrame.new(char.Torso.CFrame.p,Vector3.new(ps.x,char.Torso.CFrame.p.y,ps.z))
  240. end
  241. if laser then
  242. beamm.Parent=workspace
  243. beam.Parent=beamm
  244. inner.Parent=beamm
  245. expl.Parent=beamm
  246. exa.Parent=beamm
  247. s1.Volume=s1.Volume-.0
  248.  
  249. ray=Ray.new((wep.CFrame*cf(0,-1.5,0)).p,((wep.CFrame*cf(0,-10,0)).p-(wep.CFrame*cf(0,-1.5,0)).p).unit*999)
  250. hit,pos=workspace:FindPartOnRayWithIgnoreList(ray,{char,beamm})
  251.  
  252. if hit and hit.Parent:findFirstChild('Humanoid') and s1.Volume > .3 and parti/8==math.floor(parti/8) then
  253. Instance.new('Explosion',workspace).Position=pos
  254. end
  255. if hit and hit.Parent==workspace.Terrain or hit==workspace.Terrain and parti/8==math.floor(parti/8) then
  256. e=Instance.new('Explosion',workspace)
  257. e.Position=pos
  258. e.BlastRadius=14
  259. e.BlastPressure=1e4
  260. end
  261. if hit and not hit.Anchored and not (hit:GetMass()>1e4) then
  262. hit.Velocity=hit.Velocity+beam.CFrame.lookVector*(1*s1.Volume*hit:GetMass())
  263. end
  264.  
  265. if parti==math.floor(parti) then
  266. par=part:Clone()
  267. table.insert(particles,par)
  268. par.Parent=beamm
  269. par.Transparency=1-s1.Volume
  270. par.light.Range=br*s1.Volume
  271. par.CFrame=cf(pos)*ang(math.random(-180,180),math.random(-180,180),math.random(-180,180))*cf(0,0,-10)
  272. end
  273.  
  274. mag=((wep.CFrame*cf(0,-1.5,0)).p-pos).magnitude
  275. ms.Scale=v3(s1.Volume,s1.Volume,mag)
  276. ms2.Scale=v3(ms.Scale.x/2,ms.Scale.y/2,mag-(.1/mag))
  277. beam.CFrame=cf((wep.CFrame*cf(0,-1.5,0)).p,pos)*cf(0,0,-mag/2)*ang(0,0,math.random(0,180))
  278. inner.CFrame=beam.CFrame
  279. pl.Range=br*s1.Volume
  280. pl2.Range=br*s1.Volume
  281. expl.Size=v3(math.random(9,13),math.random(9,13),math.random(9,13))*s1.Volume
  282. expl.Transparency=math.random(40,60)/100
  283. expl.CFrame=cf(pos)*ang(math.random(0,180),math.random(0,180),math.random(0,180))
  284. exa.Size=v3(4,4,4)*s1.Volume
  285. exa.CFrame=wep.CFrame*cf(0,-1.5,0)*ang(math.random(0,180),math.random(0,180),math.random(0,180))
  286. char.Torso.Velocity=char.Torso.Velocity-beam.CFrame.lookVector*(7*s1.Volume)
  287. end
  288. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement