Advertisement
Yesboiiiiiiiiiiiitru

Untitled

Jun 16th, 2019
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 10.49 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 Mouse = Player:GetMouse()
  75. local h,t
  76. --Give the server mouse data 30 times every second, but only if the values changed
  77. --If player is not moving their mouse, client won't fire events
  78. while wait(1/30) do
  79. if h~=Mouse.Hit or t~=Mouse.Target then
  80. h,t=Mouse.Hit,Mouse.Target
  81. Event:FireServer({isMouse=true,Target=t,Hit=h})
  82. end
  83. end]==],Player.Character)
  84. Mouse,mouse,UserInputService,ContextActionService = m,m,UIS,CAS
  85. end
  86.  
  87. Player = owner
  88. Character = Player.Character
  89. PlayerGui = Player.PlayerGui
  90. Backpack = Player.Backpack
  91. Torso = Character.Torso
  92. Head = Character.Head
  93. Humanoid = Character.Humanoid
  94. LeftArm = Character["Left Arm"]
  95. LeftLeg = Character["Left Leg"]
  96. RightArm = Character["Right Arm"]
  97. RightLeg = Character["Right Leg"]
  98. LS = Torso["Left Shoulder"]
  99. LH = Torso["Left Hip"]
  100. RS = Torso["Right Shoulder"]
  101. RH = Torso["Right Hip"]
  102. Neck = Torso.Neck
  103. it=Instance.new
  104. vt=Vector3.new
  105. cf=CFrame.new
  106. euler=CFrame.fromEulerAnglesXYZ
  107. angles=CFrame.Angles
  108.  
  109. function swait(num)
  110. if num==0 or num==nil then
  111. game:service'RunService'.RenderStepped:wait()
  112. else
  113. for i=0,num do
  114. game:service'RunService'.RenderStepped:wait()
  115. end
  116. end
  117. end
  118.  
  119. if Character:findFirstChild("SwordBall",true) ~= nil then
  120. Character:findFirstChild("SwordBall",true).Parent = nil
  121. end
  122.  
  123. function part(formfactor,parent,reflectance,transparency,brickcolor,name,size)
  124. local fp = it("Part")
  125. fp.formFactor = formfactor
  126. fp.Parent = parent
  127. fp.Reflectance = reflectance
  128. fp.Transparency = transparency
  129. fp.CanCollide = false
  130. fp.Locked=true
  131. fp.BrickColor = brickcolor
  132. fp.Name = name
  133. fp.Size = size
  134. fp.Position = Torso.Position
  135. fp.BottomSurface="Smooth"
  136. fp.TopSurface="Smooth"
  137. fp:BreakJoints()
  138. return fp
  139. end
  140.  
  141. function mesh(Mesh,part,meshtype,meshid,offset,scale)
  142. local mesh = it(Mesh)
  143. mesh.Parent = part
  144. if Mesh=="SpecialMesh" then
  145. mesh.MeshType = meshtype
  146. mesh.MeshId = meshid
  147. end
  148. mesh.Offset=offset
  149. mesh.Scale=scale
  150. return mesh
  151. end
  152.  
  153. function weld(parent,part0,part1,c0)
  154. local weld = it("Weld")
  155. weld.Parent = parent
  156. weld.Part0 = part0
  157. weld.Part1 = part1
  158. weld.C0 = c0
  159. return weld
  160. end
  161.  
  162. showDamage=function(Char,Dealt,du,Color)
  163. m=Instance.new("Model")
  164. m.Name=tostring(Dealt)
  165. h=Instance.new("Humanoid")
  166. h.Health=0
  167. h.MaxHealth=0
  168. h.Parent=m
  169. c=Instance.new("Part")
  170. c.Transparency=0
  171. c.BrickColor=Color
  172. c.Name="Head"
  173. c.TopSurface=0
  174. c.BottomSurface=0
  175. c.formFactor="Plate"
  176. c.Size=Vector3.new(1,.4,1)
  177. ms=Instance.new("CylinderMesh")
  178. ms.Scale=Vector3.new(.8,.8,.8)
  179. if CRIT==true then
  180. ms.Scale=Vector3.new(1,1.25,1)
  181. end
  182. ms.Parent=c
  183. c.Reflectance=0
  184. Instance.new("BodyGyro").Parent=c
  185. c.Parent=m
  186. c.CFrame=CFrame.new(Char["Head"].CFrame.p+Vector3.new(0,1.5,0))
  187. f=Instance.new("BodyPosition")
  188. f.P=2000
  189. f.D=100
  190. f.maxForce=Vector3.new(math.huge,math.huge,math.huge)
  191. f.position=c.Position+Vector3.new(0,3,0)
  192. f.Parent=c
  193. game:GetService("Debris"):AddItem(m,.5+du)
  194. c.CanCollide=false
  195. m.Parent=workspace
  196. c.CanCollide=false
  197. end
  198.  
  199. local swordball=Instance.new("Model")
  200. swordball.Parent=Character
  201. swordball.Name="SwordBall"
  202. local proppart=part(1,swordball,0,1,BrickColor.new("Black"),"Derp",vt(1,1,1))
  203. local sou=Instance.new("Sound")
  204. sou.Parent=proppart
  205. sou.Volume=1
  206. sou.Pitch=1
  207. sou.SoundId="http://www.roblox.com/asset/?id=168589016"
  208. sou.Looped=true
  209. --sou:play()
  210.  
  211. local propwld=weld(proppart,proppart,Torso,euler(0,0,0)*cf(0,-9,0))
  212.  
  213. local prt1=part(3,swordball,0,1,BrickColor:Random(),"BallRef",vt(2,2,2))
  214. local prt2=part(3,swordball,0,0,BrickColor:Random(),"Ball",vt(1,1,1))
  215.  
  216. local msh2=mesh("SpecialMesh",prt2,"Sphere","",vt(0,0,0),vt(3,3,3))
  217.  
  218. local wld2=weld(prt2,prt2,prt1,cf(0,0,0)*euler(0,0,0))
  219. coroutine.resume(coroutine.create(function(Weld,Part)
  220. derp=0
  221. while Part.Parent~=nil do
  222. swait()
  223. wld2.C0=euler(0,derp,0)
  224. derp=derp+0.1
  225. end
  226. end),wld2,prt2)
  227.  
  228. numb=0
  229. numb2=0
  230. for i=1,8 do
  231. for i=1,8 do
  232. local prt3=part(3,swordball,0,0,BrickColor:Random(),"Sword",vt(1,1,1))
  233. local msh3=mesh("SpecialMesh",prt3,"FileMesh","http://www.roblox.com/asset/?id=1029523",vt(0,0,0),vt(0.05,0.05,0.05))
  234. --http://www.roblox.com/asset/?id=1029523
  235. local wld3=weld(prt3,prt3,prt2,cf(0,0,2.5)*euler(numb,numb2,numb2))
  236. numb=numb+0.785
  237. end
  238. numb2=numb2+0.785
  239. end
  240.  
  241. prop=Instance.new("RocketPropulsion")
  242. prop.MaxSpeed=5000
  243. prop.CartoonFactor=0
  244. prop.MaxThrust=100000
  245. prop.Parent=prt2
  246. prop.Target=proppart
  247. prop.ThrustD=1.5
  248. prop.TurnD=0
  249. prop.TurnP=0
  250. prop:Fire()
  251.  
  252. --[[velp=Instance.new("BodyGyro")
  253. velp.Parent=prt1
  254. velp.maxTorque=Vector3.new(4e+005,4e+005,4e+005)*math.huge
  255. velp.P=20e+003
  256. velp.cframe=cf(0,0,0)
  257. coroutine.resume(coroutine.create(function(Velo,Part)
  258. while Part.Parent~=nil do
  259. for i=0,1,0.1 do
  260. swait()
  261. Velo.cframe=Velo.cframe*euler(0,3.14*i,0)
  262. end
  263. end
  264. end),velp,sprt)]]
  265. --[[wait(5)
  266. local sou=Instance.new("Sound")
  267. sou.Parent=prt1
  268. sou.Volume=1
  269. sou.Pitch=1
  270. sou.SoundId="rbxasset://sounds\\unsheath.wav"
  271. sou.Looped=true
  272. wait()
  273. sou:play() ]]
  274. while true do
  275. swait(200)
  276. for d=1,1 do
  277. for _,c in pairs(workspace:children()) do
  278. local hum=c:findFirstChild("Humanoid")
  279. if hum~=nil then
  280. local head=c:findFirstChild("Torso")
  281. if head~=nil then
  282. local targ=head.Position-prt1.Position
  283. local mag=targ.magnitude
  284. if mag<=10000 and c.Name~=Player.Name then
  285. local sprt=part(3,workspace,0,1,BrickColor:Random(),"Sword",vt(6,6,6))
  286. local sprt2=part(3,workspace,0,0,BrickColor:Random(),"Sword",vt(1,1,1))
  287. local smsh=mesh("SpecialMesh",sprt2,"FileMesh","http://www.roblox.com/asset/?id=1029523",vt(0,0,0),vt(0.1,0.1,0.1))
  288. local swld=weld(sprt2,sprt2,sprt,euler(0,0,0))
  289. local teh=0
  290. game:GetService("Debris"):AddItem(sprt,20)
  291. game:GetService("Debris"):AddItem(sprt2,20)
  292. coroutine.resume(coroutine.create(function(Weld,Part)
  293. numb1=0
  294. while Part.Parent~=nil do
  295. swait()
  296. Part.BrickColor=BrickColor:Random()
  297. Weld.C0=Weld.C0*angles(0,numb1,0)
  298. numb1=math.pi/math.random(10,20)
  299. end
  300. end),swld,sprt2)
  301. sprt.CFrame=prt1.CFrame
  302. sprt.Velocity=vt(-math.random(20,50),math.random(20,50),-math.random(20,50))
  303. --[[if d==1 then
  304. sprt.Velocity=vt(math.random(50,200),math.random(20,50),0)
  305. elseif d==2 then
  306. sprt.Velocity=vt(-math.random(50,200),math.random(20,50),0)
  307. elseif d==3 then
  308. sprt.Velocity=vt(0,math.random(20,50),math.random(50,200))
  309. elseif d==4 then
  310. sprt.Velocity=vt(0,math.random(20,50),-math.random(50,200))
  311. end]]
  312. local sou=Instance.new("Sound")
  313. sou.Parent=sprt
  314. sou.Volume=1
  315. sou.Pitch=1
  316. sou.SoundId="http://www.roblox.com/asset/?id=166545328"
  317. --sou.SoundId="http://www.roblox.com/asset/?id=168589016"
  318. sou.Looped=true
  319. sou:play()
  320. prop=Instance.new("RocketPropulsion")
  321. prop.MaxSpeed=50000
  322. prop.CartoonFactor=0
  323. prop.MaxThrust=100000
  324. prop.Parent=sprt
  325. prop.Target=head
  326. --[[prop.TurnD=0
  327. prop.TurnP=100]]
  328. prop:Fire()
  329. con1=sprt.Touched:connect(function(hit)
  330. if hit.Parent==nil then
  331. return
  332. end
  333. h=hit.Parent:FindFirstChild("Humanoid")
  334. for _,v in pairs(hit.Parent:children()) do
  335. if v:IsA("Humanoid") then
  336. h=v
  337. end
  338. end
  339. if h~=nil and hit.Parent.Name~=Character.Name and hit.Parent:FindFirstChild("Torso")~=nil then
  340. if h.Health~=0 then
  341. sprt.Parent=nil
  342. sprt2.Parent=nil
  343. damage=math.random(999999,99999999)
  344. h:TakeDamage(damage)
  345. hit:BreakJoints()
  346. hit.Anchored=false
  347. hit.Velocity=Vector3.new(math.random(-100,100),math.random(-100,100),math.random(-100,100))
  348. showDamage(h.Parent,damage,1,BrickColor.new("Bright red"))
  349. local sou=Instance.new("Sound")
  350. sou.Parent=hit
  351. sou.Volume=1
  352. sou.Pitch=1
  353. sou.SoundId="http://www.roblox.com/asset/?id=168009623"
  354. sou.Looped=false
  355. --sou:play()
  356. end
  357. elseif hit.Name~="Base" and hit.Parent~=swordball and hit.Parent.Name~=Character.Name and hit.Name~="Sword" then
  358. hit:BreakJoints()
  359. hit.Velocity=Vector3.new(math.random(-100,100),math.random(-100,100),math.random(-100,100))
  360. hit.Anchored=false
  361. end
  362. end)
  363. end
  364. end
  365. end
  366. end
  367. end
  368. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement