lafur

Untitled

Sep 9th, 2018
100
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 10.65 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,Mouse,mouse,UserInputService,ContextActionService = owner
  4. local RealPlayer = Player
  5. do print("FE Compatibility code by Mokiros")local a=RealPlayer;script.Parent=a.Character;local b=Instance.new("RemoteEvent")b.Name="UserInput_Event"local function c()local d={_fakeEvent=true,Functions={},Connect=function(self,e)table.insert(self.Functions,e)end}d.connect=d.Connect;return d end;local f={Target=nil,Hit=CFrame.new(),KeyUp=c(),KeyDown=c(),Button1Up=c(),Button1Down=c(),Button2Up=c(),Button2Down=c()}local g={InputBegan=c(),InputEnded=c()}local CAS={Actions={},BindAction=function(self,h,i,j,...)CAS.Actions[h]=i and{Name=h,Function=i,Keys={...}}or nil end}CAS.UnbindAction=CAS.BindAction;local function k(self,l,...)local d=f[l]if d and d._fakeEvent then for m,e in pairs(d.Functions)do e(...)end end end;f.TrigEvent=k;g.TrigEvent=k;b.OnServerEvent:Connect(function(n,o)if n~=a then return end;f.Target=o.Target;f.Hit=o.Hit;if not o.isMouse then local p=o.UserInputState==Enum.UserInputState.Begin;if o.UserInputType==Enum.UserInputType.MouseButton1 then return f:TrigEvent(p and"Button1Down"or"Button1Up")end;if o.UserInputType==Enum.UserInputType.MouseButton2 then return f:TrigEvent(p and"Button2Down"or"Button2Up")end;for m,d in pairs(CAS.Actions)do for m,q in pairs(d.Keys)do if q==o.KeyCode then d.Function(d.Name,o.UserInputState,o)end end end;f:TrigEvent(p and"KeyDown"or"KeyUp",o.KeyCode.Name:lower())g:TrigEvent(p and"InputBegan"or"InputEnded",o,false)end end)b.Parent=NLS([==[local a=game:GetService("Players").LocalPlayer;local b=script:WaitForChild("UserInput_Event")local c=a:GetMouse()local d=game:GetService("UserInputService")local e=function(f,g)if g then return end;b:FireServer({KeyCode=f.KeyCode,UserInputType=f.UserInputType,UserInputState=f.UserInputState,Hit=c.Hit,Target=c.Target})end;d.InputBegan:Connect(e)d.InputEnded:Connect(e)local h,i;while wait(1/30)do if h~=c.Hit or i~=c.Target then h,i=c.Hit,c.Target;b:FireServer({isMouse=true,Target=i,Hit=h})end end]==],Player.Character)local r=game;local s={__index=function(self,q)local t=rawget(self,"_RealService")if t then return typeof(t[q])=="function"and function(m,...)return t[q](t,...)end or t[q]end end,__newindex=function(self,q,u)local t=rawget(self,"_RealService")if t then t[q]=u end end}local function v(d,w)d._RealService=typeof(w)=="string"and r:GetService(w)or w;return setmetatable(d,s)end;local x={GetService=function(self,t)return rawget(self,t)or r:GetService(t)end,Players=v({LocalPlayer=v({GetMouse=function(self)return f end},Player)},"Players"),UserInputService=v(g,"UserInputService"),ContextActionService=v(CAS,"ContextActionService"),RunService=v({_btrs={},RenderStepped=r:GetService("RunService").Heartbeat,BindToRenderStep=function(self,h,m,i)self._btrs[h]=self.Heartbeat:Connect(i)end,UnbindFromRenderStep=function(self,h)self._btrs[h]:Disconnect()end},"RunService")}rawset(x.Players,"localPlayer",x.Players.LocalPlayer)x.service=x.GetService;v(x,game)game,owner=x,x.Players.LocalPlayer end Player = game:GetService("Players").LocalPlayer
  6. Character = Player.Character
  7. PlayerGui = Player.PlayerGui
  8. Backpack = Player.Backpack
  9. Torso = Character.Torso
  10. Head = Character.Head
  11. Humanoid = Character.Humanoid
  12. LeftArm = Character["Left Arm"]
  13. LeftLeg = Character["Left Leg"]
  14. RightArm = Character["Right Arm"]
  15. RightLeg = Character["Right Leg"]
  16. LS = Torso["Left Shoulder"]
  17. LH = Torso["Left Hip"]
  18. RS = Torso["Right Shoulder"]
  19. RH = Torso["Right Hip"]
  20. Neck = Torso.Neck
  21. it=Instance.new
  22. vt=Vector3.new
  23. cf=CFrame.new
  24. euler=CFrame.fromEulerAnglesXYZ
  25. angles=CFrame.Angles
  26.  
  27. function swait(num)
  28. if num==0 or num==nil then
  29. game:service'RunService'.RenderStepped:wait()
  30. else
  31. for i=0,num do
  32. game:service'RunService'.RenderStepped:wait()
  33. end
  34. end
  35. end
  36.  
  37. if Character:findFirstChild("SwordBall",true) ~= nil then
  38. Character:findFirstChild("SwordBall",true).Parent = nil
  39. end
  40.  
  41. function part(formfactor,parent,reflectance,transparency,brickcolor,name,size)
  42. local fp = it("Part")
  43. fp.formFactor = formfactor
  44. fp.Parent = parent
  45. fp.Reflectance = reflectance
  46. fp.Transparency = transparency
  47. fp.CanCollide = false
  48. fp.Locked=true
  49. fp.BrickColor = brickcolor
  50. fp.Name = name
  51. fp.Size = size
  52. fp.Position = Torso.Position
  53. fp.BottomSurface="Smooth"
  54. fp.TopSurface="Smooth"
  55. fp:BreakJoints()
  56. return fp
  57. end
  58.  
  59. function mesh(Mesh,part,meshtype,meshid,offset,scale)
  60. local mesh = it(Mesh)
  61. mesh.Parent = part
  62. if Mesh=="SpecialMesh" then
  63. mesh.MeshType = meshtype
  64. mesh.MeshId = meshid
  65. end
  66. mesh.Offset=offset
  67. mesh.Scale=scale
  68. return mesh
  69. end
  70.  
  71. function weld(parent,part0,part1,c0)
  72. local weld = it("Weld")
  73. weld.Parent = parent
  74. weld.Part0 = part0
  75. weld.Part1 = part1
  76. weld.C0 = c0
  77. return weld
  78. end
  79.  
  80. showDamage=function(Char,Dealt,du,Color)
  81. m=Instance.new("Model")
  82. m.Name=tostring(Dealt)
  83. h=Instance.new("Humanoid")
  84. h.Health=0
  85. h.MaxHealth=0
  86. h.Parent=m
  87. c=Instance.new("Part")
  88. c.Transparency=0
  89. c.BrickColor=Color
  90. c.Name="Head"
  91. c.TopSurface=0
  92. c.BottomSurface=0
  93. c.formFactor="Plate"
  94. c.Size=Vector3.new(1,.4,1)
  95. ms=Instance.new("CylinderMesh")
  96. ms.Scale=Vector3.new(.8,.8,.8)
  97. if CRIT==true then
  98. ms.Scale=Vector3.new(1,1.25,1)
  99. end
  100. ms.Parent=c
  101. c.Reflectance=0
  102. Instance.new("BodyGyro").Parent=c
  103. c.Parent=m
  104. c.CFrame=CFrame.new(Char["Head"].CFrame.p+Vector3.new(0,1.5,0))
  105. f=Instance.new("BodyPosition")
  106. f.P=2000
  107. f.D=100
  108. f.maxForce=Vector3.new(math.huge,math.huge,math.huge)
  109. f.position=c.Position+Vector3.new(0,3,0)
  110. f.Parent=c
  111. game:GetService("Debris"):AddItem(m,.5+du)
  112. c.CanCollide=false
  113. m.Parent=workspace
  114. c.CanCollide=false
  115. end
  116.  
  117. local swordball=Instance.new("Model")
  118. swordball.Parent=Character
  119. swordball.Name="SwordBall"
  120. local proppart=part(1,swordball,0,1,BrickColor.new("Black"),"Derp",vt(1,1,1))
  121. local sou=Instance.new("Sound")
  122. sou.Parent=proppart
  123. sou.Volume=1
  124. sou.Pitch=1
  125. sou.SoundId="http://www.roblox.com/asset/?id=168589016"
  126. sou.Looped=true
  127. --sou:play()
  128.  
  129. local propwld=weld(proppart,proppart,Torso,euler(0,0,0)*cf(0,-9,0))
  130.  
  131. local prt1=part(3,swordball,0,1,BrickColor:Random(),"BallRef",vt(2,2,2))
  132. local prt2=part(3,swordball,0,0,BrickColor:Random(),"Ball",vt(1,1,1))
  133.  
  134. local msh2=mesh("SpecialMesh",prt2,"Sphere","",vt(0,0,0),vt(3,3,3))
  135.  
  136. local wld2=weld(prt2,prt2,prt1,cf(0,0,0)*euler(0,0,0))
  137. coroutine.resume(coroutine.create(function(Weld,Part)
  138. derp=0
  139. while Part.Parent~=nil do
  140. swait()
  141. wld2.C0=euler(0,derp,0)
  142. derp=derp+0.1
  143. end
  144. end),wld2,prt2)
  145.  
  146. numb=0
  147. numb2=0
  148. for i=1,8 do
  149. for i=1,8 do
  150. local prt3=part(3,swordball,0,0,BrickColor:Random(),"Sword",vt(1,1,1))
  151. local msh3=mesh("SpecialMesh",prt3,"FileMesh","http://www.roblox.com/asset/?id=1029523",vt(0,0,0),vt(0.05,0.05,0.05))
  152. --http://www.roblox.com/asset/?id=1029523
  153. local wld3=weld(prt3,prt3,prt2,cf(0,0,2.5)*euler(numb,numb2,numb2))
  154. numb=numb+0.785
  155. end
  156. numb2=numb2+0.785
  157. end
  158.  
  159. prop=Instance.new("RocketPropulsion")
  160. prop.MaxSpeed=5000
  161. prop.CartoonFactor=0
  162. prop.MaxThrust=100000
  163. prop.Parent=prt2
  164. prop.Target=proppart
  165. prop.ThrustD=1.5
  166. prop.TurnD=0
  167. prop.TurnP=0
  168. prop:Fire()
  169.  
  170. --[[velp=Instance.new("BodyGyro")
  171. velp.Parent=prt1
  172. velp.maxTorque=Vector3.new(4e+005,4e+005,4e+005)*math.huge
  173. velp.P=20e+003
  174. velp.cframe=cf(0,0,0)
  175. coroutine.resume(coroutine.create(function(Velo,Part)
  176. while Part.Parent~=nil do
  177. for i=0,1,0.1 do
  178. swait()
  179. Velo.cframe=Velo.cframe*euler(0,3.14*i,0)
  180. end
  181. end
  182. end),velp,sprt)]]
  183. --[[wait(5)
  184. local sou=Instance.new("Sound")
  185. sou.Parent=prt1
  186. sou.Volume=1
  187. sou.Pitch=1
  188. sou.SoundId="rbxasset://sounds\\unsheath.wav"
  189. sou.Looped=true
  190. wait()
  191. sou:play() ]]
  192. while true do
  193. swait(200)
  194. for d=1,1 do
  195. for _,c in pairs(workspace:children()) do
  196. local hum=c:findFirstChild("Humanoid")
  197. if hum~=nil then
  198. local head=c:findFirstChild("Torso")
  199. if head~=nil then
  200. local targ=head.Position-prt1.Position
  201. local mag=targ.magnitude
  202. if mag<=10000 and c.Name~=Player.Name then
  203. local sprt=part(3,workspace,0,1,BrickColor:Random(),"Sword",vt(6,6,6))
  204. local sprt2=part(3,workspace,0,0,BrickColor:Random(),"Sword",vt(1,1,1))
  205. local smsh=mesh("SpecialMesh",sprt2,"FileMesh","http://www.roblox.com/asset/?id=1029523",vt(0,0,0),vt(0.1,0.1,0.1))
  206. local swld=weld(sprt2,sprt2,sprt,euler(0,0,0))
  207. local teh=0
  208. game:GetService("Debris"):AddItem(sprt,20)
  209. game:GetService("Debris"):AddItem(sprt2,20)
  210. coroutine.resume(coroutine.create(function(Weld,Part)
  211. numb1=0
  212. while Part.Parent~=nil do
  213. swait()
  214. Part.BrickColor=BrickColor:Random()
  215. Weld.C0=Weld.C0*angles(0,numb1,0)
  216. numb1=math.pi/math.random(10,20)
  217. end
  218. end),swld,sprt2)
  219. sprt.CFrame=prt1.CFrame
  220. sprt.Velocity=vt(-math.random(20,50),math.random(20,50),-math.random(20,50))
  221. --[[if d==1 then
  222. sprt.Velocity=vt(math.random(50,200),math.random(20,50),0)
  223. elseif d==2 then
  224. sprt.Velocity=vt(-math.random(50,200),math.random(20,50),0)
  225. elseif d==3 then
  226. sprt.Velocity=vt(0,math.random(20,50),math.random(50,200))
  227. elseif d==4 then
  228. sprt.Velocity=vt(0,math.random(20,50),-math.random(50,200))
  229. end]]
  230. local sou=Instance.new("Sound")
  231. sou.Parent=sprt
  232. sou.Volume=1
  233. sou.Pitch=1
  234. sou.SoundId="http://www.roblox.com/asset/?id=166545328"
  235. --sou.SoundId="http://www.roblox.com/asset/?id=168589016"
  236. sou.Looped=true
  237. sou:play()
  238. prop=Instance.new("RocketPropulsion")
  239. prop.MaxSpeed=50000
  240. prop.CartoonFactor=0
  241. prop.MaxThrust=100000
  242. prop.Parent=sprt
  243. prop.Target=head
  244. --[[prop.TurnD=0
  245. prop.TurnP=100]]
  246. prop:Fire()
  247. con1=sprt.Touched:connect(function(hit)
  248. if hit.Parent==nil then
  249. return
  250. end
  251. h=hit.Parent:FindFirstChild("Humanoid")
  252. for _,v in pairs(hit.Parent:children()) do
  253. if v:IsA("Humanoid") then
  254. h=v
  255. end
  256. end
  257. if h~=nil and hit.Parent.Name~=Character.Name and hit.Parent:FindFirstChild("Torso")~=nil then
  258. if h.Health~=0 then
  259. sprt.Parent=nil
  260. sprt2.Parent=nil
  261. damage=math.random(999999,99999999)
  262. h:TakeDamage(damage)
  263. hit:BreakJoints()
  264. hit.Anchored=false
  265. hit.Velocity=Vector3.new(math.random(-100,100),math.random(-100,100),math.random(-100,100))
  266. showDamage(h.Parent,damage,1,BrickColor.new("Bright red"))
  267. local sou=Instance.new("Sound")
  268. sou.Parent=hit
  269. sou.Volume=1
  270. sou.Pitch=1
  271. sou.SoundId="http://www.roblox.com/asset/?id=168009623"
  272. sou.Looped=false
  273. --sou:play()
  274. end
  275. elseif hit.Name~="Base" and hit.Parent~=swordball and hit.Parent.Name~=Character.Name and hit.Name~="Sword" then
  276. hit:BreakJoints()
  277. hit.Velocity=Vector3.new(math.random(-100,100),math.random(-100,100),math.random(-100,100))
  278. hit.Anchored=false
  279. end
  280. end)
  281. end
  282. end
  283. end
  284. end
  285. end
  286. end
Add Comment
Please, Sign In to add comment