vibrantsinger423

cronk2

May 13th, 2019
195
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 9.68 KB | None | 0 0
  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
  6.  
  7. Player=game:GetService("Players").LocalPlayer
  8. Character=Player.Character
  9. Torso=Character.Torso
  10. euler=CFrame.fromEulerAnglesXYZ
  11. it=Instance.new
  12. vt=Vector3.new
  13. cf=CFrame.new
  14. local Effects={}
  15. mouse=Player:GetMouse()
  16.  
  17. function NoOutline(Part)
  18. Part.TopSurface,Part.BottomSurface,Part.LeftSurface,Part.RightSurface,Part.FrontSurface,Part.BackSurface = 10,10,10,10,10,10
  19. end
  20.  
  21. function part(formfactor,parent,material,reflectance,transparency,brickcolor,name,size)
  22. local fp=it("Part")
  23. fp.formFactor=formfactor
  24. fp.Parent=parent
  25. fp.Reflectance=reflectance
  26. fp.Transparency=transparency
  27. fp.CanCollide=false
  28. fp.Locked=true
  29. fp.BrickColor=BrickColor.new(tostring(brickcolor))
  30. fp.Name=name
  31. fp.Size=size
  32. fp.Position=Character.Torso.Position
  33. NoOutline(fp)
  34. fp.Material=material
  35. fp:BreakJoints()
  36. return fp
  37. end
  38.  
  39. function mesh(Mesh,part,meshtype,meshid,offset,scale)
  40. local mesh=it(Mesh)
  41. mesh.Parent=part
  42. if Mesh=="SpecialMesh" then
  43. mesh.MeshType=meshtype
  44. mesh.MeshId=meshid
  45. end
  46. mesh.Offset=offset
  47. mesh.Scale=scale
  48. return mesh
  49. end
  50.  
  51. function weld(parent,part0,part1,c0)
  52. local weld=it("Weld")
  53. weld.Parent=parent
  54. weld.Part0=part0
  55. weld.Part1=part1
  56. weld.C0=c0
  57. return weld
  58. end
  59.  
  60. function swait(num)
  61. if num==0 or num==nil then
  62. game:service'RunService'.Stepped:wait(0)
  63. else
  64. for i=0,num do
  65. game:service'RunService'.Stepped:wait(0)
  66. end
  67. end
  68. end
  69.  
  70. function MagicBlockx(brickcolor,cframe,x1,y1,z1,x3,y3,z3,delay)
  71. local prt=part(3,workspace,"Neon",0,0,brickcolor,"Effect",vt())
  72. prt.Anchored=true
  73. prt.CFrame=cframe
  74. msh=mesh("BlockMesh",prt,"","",vt(0,0,0),vt(x1,y1,z1))
  75. game:GetService("Debris"):AddItem(prt,5)
  76. table.insert(Effects,{prt,"Block1",delay,x3,y3,z3}) --part, type, delay
  77. end
  78.  
  79. so = function(id,par,vol,pit)
  80. coroutine.resume(coroutine.create(function()
  81. local sou = Instance.new("Sound",par or workspace)
  82. sou.Volume=vol
  83. sou.Pitch=pit or 1
  84. sou.SoundId=id
  85. swait()
  86. sou:play()
  87. game:GetService("Debris"):AddItem(sou,6)
  88. end))
  89. end
  90.  
  91. function rayCast(Pos, Dir, Max, Ignore) -- Origin Position , Direction, MaxDistance , IgnoreDescendants
  92. return game:service("Workspace"):FindPartOnRay(Ray.new(Pos, Dir.unit * (Max or 999.999)), Ignore)
  93. end
  94.  
  95. function MagicCylinder(brickcolor,cframe,x1,y1,z1,x3,y3,z3,delay)
  96. local prt=part(3,workspace,"Neon",0,0,brickcolor,"Effect",vt(0.2,0.2,0.2))
  97. prt.Anchored=true
  98. prt.CFrame=cframe
  99. msh=mesh("SpecialMesh",prt,"Head","",vt(0,0,0),vt(x1,y1,z1))
  100. game:GetService("Debris"):AddItem(prt,2)
  101. coroutine.resume(coroutine.create(function(Part,Mesh)
  102. for i=0,1,delay do
  103. swait()
  104. Part.CFrame=Part.CFrame
  105. Part.Transparency=i
  106. Mesh.Scale=Mesh.Scale+vt(x3,y3,z3)
  107. end
  108. Part.Parent=nil
  109. end),prt,msh)
  110. end
  111.  
  112. function MagicCirclex(brickcolor,cframe,x1,y1,z1,x3,y3,z3,delay)
  113. local prt=part(3,workspace,"Neon",0,0,brickcolor,"Effect",vt(0.5,0.5,0.5))
  114. prt.Anchored=true
  115. prt.CFrame=cframe
  116.  
  117. prt.CanCollide = false
  118. msh=mesh("SpecialMesh",prt,"Sphere","",vt(0,0,0),vt(x1,y1,z1))
  119. game:GetService("Debris"):AddItem(prt,2)
  120. coroutine.resume(coroutine.create(function(Part,Mesh)
  121. for i=0,1,delay do
  122. swait()
  123. Part.CFrame=Part.CFrame
  124. Part.Transparency=i
  125. Mesh.Scale=Mesh.Scale+vt(x3,y3,z3)
  126. end
  127. Part.Parent=nil
  128. end),prt,msh)
  129. end
  130.  
  131. function MagicRingx(brickcolor,cframe,x1,y1,z1,x3,y3,z3,delay)
  132. local prt=part(3,workspace,"Neon",0,0,brickcolor,"Effect",vt(0.5,0.5,0.5))
  133. prt.Anchored=true
  134. prt.CFrame=cframe
  135. msh=mesh("SpecialMesh",prt,"FileMesh","http://www.roblox.com/asset/?id=3270017",vt(0,0,0),vt(x1,y1,z1))
  136. game:GetService("Debris"):AddItem(prt,2)
  137. coroutine.resume(coroutine.create(function(Part,Mesh,num)
  138. for i=0,1,delay do
  139. swait()
  140. Part.Transparency=i
  141. Mesh.Scale=Mesh.Scale+vt(x3,y3,z3)
  142. end
  143. Part.Parent=nil
  144. end),prt,msh,(math.random(0,1)+math.random())/5)
  145. end
  146.  
  147. mouse.KeyDown:connect(function(k)
  148. k=k:lower()
  149. if k=='e' then
  150. lazor()
  151. end
  152. end)
  153.  
  154. function lazor()
  155. --[[
  156. local orb=part(3,Character,"Neon",0,1,BrickColor.new("Dark blue"),"Orb",vt())
  157. local omsh=mesh("SpecialMesh",orb,"Sphere","",vt(0,0,0),vt(15,15,15))
  158. local owld=weld(orb,orb,Torso,cf(0,-1.5,8),cf(0,0,0))
  159. so("http://roblox.com/asset/?id=169445572",orb,1,0.9)
  160. so("http://roblox.com/asset/?id=169380495",orb,1,0.6)
  161. so("http://roblox.com/asset/?id=203691346",orb,1,0.9)
  162. for i=1,0.3,-0.01 do
  163. wait()
  164. orb.Transparency=i
  165. omsh.Scale=omsh.Scale+vt(0.5,0.5,0.5)
  166. MagicBlockx(BrickColor.new("Really black"),orb.CFrame,15,15,15,2,2,2,0.1)
  167. local ef=part(3,workspace,"Neon",0,0,BrickColor.new("Dark blue"),"Effect",vt())
  168. ef.Anchored=true
  169. local emsh=mesh("SpecialMesh",ef,"Sphere","",vt(0,0,0),vt(2,math.random(1000,1500)/100,2))
  170. local ceef=euler(math.random(-50,50),math.random(-50,50),math.random(-50,50))*cf(0,math.random(10,20),0)
  171. ef.CFrame=orb.CFrame*ceef
  172. game:GetService("Debris"):AddItem(ef,2)
  173. coroutine.resume(coroutine.create(function(Part,Mesh)
  174. for i=0,1,0.1 do
  175. wait()
  176. Part.Transparency=i
  177. Part.CFrame=Part.CFrame*cf(0,-1,0)
  178. end
  179. Part.Parent=nil
  180. end),ef,emsh)
  181. end
  182. --orb orb orb
  183. local Pos=cf(orb.Position,Player:GetMouse().Hit.p).lookVector
  184. wait(.5)
  185. orb.Parent=nil ]]--
  186. local Pos=cf(Torso.Position,Player:GetMouse().Hit.p).lookVector
  187. local hit,pos = rayCast(Torso.Position,Pos,999,Character)
  188. local mag=(Torso.Position-pos).magnitude
  189. MagicCirclex(BrickColor.new("Dark blue"),cf(pos),15,15,15,8,8,8,0.02)
  190. MagicBlockx(BrickColor.new("Dark blue"),cf(pos),15,15,15,8,8,8,0.02)
  191. MagicCylinder(BrickColor.new("Dark blue"),CFrame.new((Torso.Position+pos)/2,pos)*euler(1.57,0,0),10,mag*5,10,0.5,0,0.5,0.01)
  192. for i=1,2 do
  193. --MagicRingx(BrickColor.new("Dark blue"),cf(pos)*euler(math.random(-50,50),math.random(-50,50),math.random(-50,50)),3,3,3,1,1,1,0.04)
  194. end
  195. for i=1,5 do
  196. --local tehcf=CFrame.new((orb.Position+pos)/2,pos)*euler(1.57,0,0)*cf(0,(mag/5)*(i/2),0)
  197. --MagicRingx(BrickColor.new("Really black"),tehcf*euler(1.57,0,0),1,1,1,0.5,0.5,0.5,0.01)
  198. end
  199. for i=0,5 do
  200. --local tehcf=CFrame.new((orb.Position+pos)/2,pos)*euler(1.57,0,0)*cf(0,(-mag/5)*(i/2),0)
  201. --MagicRingx(BrickColor.new("Dark blue"),tehcf*euler(1.57,0,0),1,1,1,0.5,0.5,0.5,0.01)
  202. end
  203. local ref=part(3,workspace,"Neon",0,1,BrickColor.new("Really black"),"Effect",vt())
  204. ref.CFrame=cf(pos)
  205. so("http://roblox.com/asset/?id=203691378",Torso,1,0.7)
  206. so("http://roblox.com/asset/?id=169445602",Torso,1,0.7)
  207. so("http://www.roblox.com/Asset?ID=203691282",Torso,1,.8)
  208. coroutine.resume(coroutine.create(function(Part)
  209. Part.Parent=nil
  210. end),ref)
  211. if hit~=nil then
  212. --MagniDamage(Part,hit,30,90,100,0,"Normal")
  213. end
  214. end
Advertisement
Add Comment
Please, Sign In to add comment