ghostteen14

Untitled

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