Advertisement
marioisdabomb

staff 2

Dec 2nd, 2018
413
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 22.73 KB | None | 0 0
  1.  
  2. -- This script has been converted to FE by iPxter
  3.  
  4.  
  5. if game:GetService("RunService"):IsClient() then error("Script must be server-side in order to work; use h/ and not hl/") end
  6. local Player,Mouse,mouse,UserInputService,ContextActionService = owner
  7. do
  8. print("FE Compatibility code by Mokiros | Translated to FE by iPxter")
  9. script.Parent = Player.Character
  10.  
  11. --RemoteEvent for communicating
  12. local Event = Instance.new("RemoteEvent")
  13. Event.Name = "UserInput_Event"
  14.  
  15. --Fake event to make stuff like Mouse.KeyDown work
  16. local function fakeEvent()
  17. local t = {_fakeEvent=true,Connect=function(self,f)self.Function=f end}
  18. t.connect = t.Connect
  19. return t
  20. end
  21.  
  22. --Creating fake input objects with fake variables
  23. local m = {Target=nil,Hit=CFrame.new(),KeyUp=fakeEvent(),KeyDown=fakeEvent(),Button1Up=fakeEvent(),Button1Down=fakeEvent()}
  24. local UIS = {InputBegan=fakeEvent(),InputEnded=fakeEvent()}
  25. local CAS = {Actions={},BindAction=function(self,name,fun,touch,...)
  26. CAS.Actions[name] = fun and {Name=name,Function=fun,Keys={...}} or nil
  27. end}
  28. --Merged 2 functions into one by checking amount of arguments
  29. CAS.UnbindAction = CAS.BindAction
  30.  
  31. --This function will trigger the events that have been :Connect()'ed
  32. local function te(self,ev,...)
  33. local t = m[ev]
  34. if t and t._fakeEvent and t.Function then
  35. t.Function(...)
  36. end
  37. end
  38. m.TrigEvent = te
  39. UIS.TrigEvent = te
  40.  
  41. Event.OnServerEvent:Connect(function(plr,io)
  42. if plr~=Player then return end
  43. if io.isMouse then
  44. m.Target = io.Target
  45. m.Hit = io.Hit
  46. else
  47. local b = io.UserInputState == Enum.UserInputState.Begin
  48. if io.UserInputType == Enum.UserInputType.MouseButton1 then
  49. return m:TrigEvent(b and "Button1Down" or "Button1Up")
  50. end
  51. for _,t in pairs(CAS.Actions) do
  52. for _,k in pairs(t.Keys) do
  53. if k==io.KeyCode then
  54. t.Function(t.Name,io.UserInputState,io)
  55. end
  56. end
  57. end
  58. m:TrigEvent(b and "KeyDown" or "KeyUp",io.KeyCode.Name:lower())
  59. UIS:TrigEvent(b and "InputBegan" or "InputEnded",io,false)
  60. end
  61. end)
  62. Event.Parent = NLS([==[
  63. local Player = game:GetService("Players").LocalPlayer
  64. local Event = script:WaitForChild("UserInput_Event")
  65.  
  66. local UIS = game:GetService("UserInputService")
  67. local input = function(io,a)
  68. if a then return end
  69. --Since InputObject is a client-side instance, we create and pass table instead
  70. Event:FireServer({KeyCode=io.KeyCode,UserInputType=io.UserInputType,UserInputState=io.UserInputState})
  71. end
  72. UIS.InputBegan:Connect(input)
  73. UIS.InputEnded:Connect(input)
  74.  
  75. local Mouse = Player:GetMouse()
  76. local h,t
  77. --Give the server mouse data 30 times every second, but only if the values changed
  78. --If player is not moving their mouse, client won't fire events
  79. while wait(1/30) do
  80. if h~=Mouse.Hit or t~=Mouse.Target then
  81. h,t=Mouse.Hit,Mouse.Target
  82. Event:FireServer({isMouse=true,Target=t,Hit=h})
  83. end
  84. end]==],Player.Character)
  85. Mouse,mouse,UserInputService,ContextActionService = m,m,UIS,CAS
  86. end
  87. --[[
  88. Wizard staff, by aleksa12432, published by him.
  89. Local script, just run, don't change anything (except if you know what you are doing)
  90. You can use this whenever you want, edit it, but please put my credit
  91. ]]--
  92. LocalPlayer = owner
  93. Activated = false
  94. Equipped = false
  95. Regening = false
  96. FireBall = false
  97. Spikes = false
  98. ForceField = false
  99. shooting = false
  100. Mode = "Shoot"
  101. Energy = 100
  102. mouse = LocalPlayer:GetMouse()
  103. t = Instance.new("Tool",LocalPlayer.Backpack)
  104. t.Name = 'Wizard staff'
  105. t.GripPos = Vector3.new(0,-2,0)
  106. p = Instance.new("Part",t)
  107. p.FormFactor = 'Custom'
  108. p.Name = 'Handle'
  109. p.CanCollide = false
  110. m = Instance.new("SpecialMesh",p)
  111. m.MeshId = 'http://www.roblox.com/asset/?id=18434043'
  112. m.TextureId = 'http://www.roblox.com/asset/?id=26017177'
  113. char = LocalPlayer.Character
  114. mouse = LocalPlayer:GetMouse()
  115. humanoid = char:findFirstChild("Humanoid")
  116. torso = char:findFirstChild("Torso")
  117. head = char.Head
  118. ra = char:findFirstChild("Right Arm")
  119. la = char:findFirstChild("Left Arm")
  120. rl = char:findFirstChild("Right Leg")
  121. ll = char:findFirstChild("Left Leg")
  122. rs = torso:findFirstChild("Right Shoulder")
  123. ls = torso:findFirstChild("Left Shoulder")
  124. rh = torso:findFirstChild("Right Hip")
  125. lh = torso:findFirstChild("Left Hip")
  126. neck = torso:findFirstChild("Neck")
  127. rj = char:findFirstChild("HumanoidRootPart"):findFirstChild("RootJoint")
  128. anim = char:findFirstChild("Animate")
  129. rootpart = char:findFirstChild("HumanoidRootPart")
  130. camera = workspace.CurrentCamera
  131. if anim then
  132. anim:Destroy()
  133. end
  134. rm = Instance.new("Motor", torso)
  135. rm.C0 = CFrame.new(1.5, 0.5, 0) *CFrame.Angles(0, 0, 0)
  136. rm.C1 = CFrame.new(0, 0.5, 0)
  137. rm.Part0 = torso
  138. rm.Part1 = ra
  139. lm = Instance.new("Motor", torso)
  140. lm.C0 = CFrame.new(-1.5, 0.5, 0) *CFrame.Angles(0, 0, 0)
  141. lm.C1 = CFrame.new(0, 0.5, 0)
  142. lm.Part0 = torso
  143. lm.Part1 = la
  144. rlegm = Instance.new("Motor", torso)
  145. rlegm.C0 = CFrame.new(0.5, -1, 0) *CFrame.Angles(0, 0, 0)
  146. rlegm.C1 = CFrame.new(0, 1, 0)
  147. rlegm.Part0 = torso
  148. rlegm.Part1 = rl
  149. llegm = Instance.new("Motor", torso)
  150. llegm.C0 = CFrame.new(-0.5, -1, 0) *CFrame.Angles(0, 0, 0)
  151. llegm.C1 = CFrame.new(0, 1, 0)
  152. llegm.Part0 = torso
  153. llegm.Part1 = ll
  154. rsc0 = rm.C0
  155. lsc0 = lm.C0
  156. llc0 = llegm.C0
  157. rlc0 = rlegm.C0
  158. neckc0 = neck.C0
  159. rootc0 = rj.C0
  160. PLAYERGUI = LocalPlayer.PlayerGui
  161. GUI = Instance.new("ScreenGui",PLAYERGUI)
  162. FRAME = Instance.new("Frame",GUI)
  163. FRAME.Size = UDim2.new(0.5,0,0.05,0)
  164. FRAME.BackgroundColor3 = BrickColor.new("Bright blue").Color
  165. FRAME.BorderSizePixel = 0
  166. TEXTLABEL = Instance.new("TextLabel",FRAME)
  167. TEXTLABEL.Size = UDim2.new(1,0,1,0)
  168. TEXTLABEL.BackgroundTransparency = 1
  169. TEXTLABEL.Text = "Mana: "..tostring(Energy)
  170. TEXTLABEL.BorderSizePixel = 0
  171. TEXTLABEL.Font = 'Legacy'
  172. TEXTLABEL.FontSize = 'Size24'
  173. FRAME2 = Instance.new("Frame",GUI)
  174. FRAME2.Size = UDim2.new(0.5,0,0.05,0)
  175. FRAME2.BackgroundColor3 = BrickColor.new("Bright red").Color
  176. FRAME2.BorderSizePixel = 0
  177. FRAME2.Position = UDim2.new(0.5,0,0,0)
  178. TEXTLABEL2 = Instance.new("TextLabel",FRAME2)
  179. TEXTLABEL2.Size = UDim2.new(1,0,1,0)
  180. TEXTLABEL2.BackgroundTransparency = 1
  181. TEXTLABEL2.Text = "Health: "..tostring(humanoid.Health)
  182. TEXTLABEL2.BorderSizePixel = 0
  183. TEXTLABEL2.Font = 'Legacy'
  184. TEXTLABEL2.FontSize = 'Size24'
  185. FRAME3 = Instance.new("Frame",GUI)
  186. FRAME3.Size = UDim2.new(0.5,0,0.05,0)
  187. FRAME3.BackgroundColor3 = BrickColor.new("Lime green").Color
  188. FRAME3.BorderSizePixel = 0
  189. FRAME3.Position = UDim2.new(0.5,0,0.05,0)
  190. TEXTLABEL3 = Instance.new("TextLabel",FRAME3)
  191. TEXTLABEL3.Size = UDim2.new(1,0,1,0)
  192. TEXTLABEL3.BackgroundTransparency = 1
  193. TEXTLABEL3.Text = "Spell: Star shoot"
  194. TEXTLABEL3.BorderSizePixel = 0
  195. TEXTLABEL3.Font = 'Legacy'
  196. TEXTLABEL3.FontSize = 'Size24'
  197. TEXTLABEL3.TextScaled = true
  198. function __getVelocity(p1,p2,speed)
  199. local dis=(p1-p2).magnitude
  200. if speed=="dis" then
  201. if dis*6>100 then
  202. speed=dis*6
  203. else
  204. speed=100
  205. end
  206. end
  207. local x=(p1.x-p2.x)/dis*speed
  208. local y=(p1.y-p2.y)/dis*speed
  209. local z=(p1.z-p2.z)/dis*speed
  210. return Vector3.new(-x,-y+10,-z)
  211. end
  212. function __onActivated()
  213. Activated = true
  214. end
  215. function __onDeactivated()
  216. Activated = false
  217. end
  218. function __onEquipped(mouse)
  219. Equipped = true
  220. pcall(function()
  221. local a = Instance.new("Explosion",LocalPlayer.Character)
  222. a.Position = LocalPlayer.Character['Right Arm'].Position
  223. a.BlastPressure = 0
  224. a.BlastRadius = 20
  225. end)
  226. local b = Instance.new("Fire",p)
  227. b.Size = 1
  228. b.Color = Color3.new(0, 255, 255)
  229. b.SecondaryColor = Color3.new(255, 255, 0)
  230. local w = Instance.new("Motor",char['Right Arm'])
  231. w.Name = 'Wizard staff weld'
  232. w.Part0 = char['Right Arm']
  233. w.Part1 = p
  234. w.C1 = CFrame.new(0,-1.5,0.5) * CFrame.Angles(math.rad(90),0,0)
  235. end
  236. function __onUnequipped(mouse)
  237. Equipped = false
  238. pcall(function()
  239. p.Fire:Destroy()
  240. end)
  241. pcall(function()
  242. char['Right Arm']['Wizard staff weld']:Destroy()
  243. end)
  244. end
  245. function __Shoot()
  246. if Regening == true then return end
  247. if Energy < 5 then return end
  248. shooting = true
  249. Energy = Energy - 5
  250. humanoid.WalkSpeed = 0
  251. local speed = math.random(400,500)
  252. local bullet = Instance.new("Part",workspace)
  253. bullet.Name = 'Bullet'
  254. bullet.TopSurface = 0
  255. bullet.BottomSurface = 0
  256. bullet.FormFactor = 'Custom'
  257. bullet.CFrame = p.CFrame
  258. bullet.CanCollide = false
  259. bullet.Velocity = __getVelocity(bullet.Position, mouse.Hit.p, speed)
  260. local bulletmesh = Instance.new("SpecialMesh",bullet)
  261. bulletmesh.MeshId = 'http://www.roblox.com/asset/?id=24388358'
  262. bulletmesh.TextureId = 'http://www.roblox.com/asset/?id=24388341'
  263. bulletmesh.VertexColor = Vector3.new(0,0,0)
  264. bullet.Touched:connect(function(toucher)
  265. if toucher.Parent:findFirstChild'Head' and toucher.Parent:findFirstChild'Torso' and toucher.Parent.Name ~= LocalPlayer.Name then
  266. for i,v in pairs(toucher.Parent:children()) do
  267. if v.ClassName == 'Humanoid' then
  268. if v.Health > 100 then
  269. v.Health = 100
  270. else
  271. v.Health = v.Health - speed/50
  272. end
  273. end
  274. end
  275. bullet:Destroy()
  276. end
  277. end)
  278. wait(1)
  279. shooting = false
  280. humanoid.WalkSpeed = 16
  281. end
  282. function __FireBall()
  283. if Regening == true then return end
  284. if Energy < 50 then return end
  285. if FireBall == true then return end
  286. if ForceField == true then return end
  287. Energy = Energy - 50
  288. local a = Instance.new("Part",workspace)
  289. a.Anchored = true
  290. a.CFrame = LocalPlayer.Character.Torso.CFrame * CFrame.new(0,0,-5)
  291. a.FormFactor = 'Custom'
  292. a.Size = Vector3.new(5,5,5)
  293. Instance.new("SpecialMesh", a).MeshType = 'Sphere'
  294. local b = Instance.new('Decal',a)
  295. b.Texture = 'http://www.roblox.com/asset/?id=58278973'
  296. b.Face = 'Right'
  297. local c = Instance.new('Decal',a)
  298. c.Texture = 'http://www.roblox.com/asset/?id=58278973'
  299. c.Face = 'Left'
  300. local d = Instance.new('Decal',a)
  301. d.Texture = 'http://www.roblox.com/asset/?id=58278973'
  302. d.Face = 'Top'
  303. local e = Instance.new('Decal',a)
  304. e.Texture = 'http://www.roblox.com/asset/?id=58278973'
  305. e.Face = 'Front'
  306. local f = Instance.new('Decal',a)
  307. f.Texture = 'http://www.roblox.com/asset/?id=58278973'
  308. f.Face = 'Back'
  309. local g = Instance.new('Decal',a)
  310. g.Texture = 'http://www.roblox.com/asset/?id=58278973'
  311. g.Face = 'Bottom'
  312. local x = Instance.new('Fire',a)
  313. x.Size = 20
  314. local con = a.Touched:connect(function(what)
  315. if what.Parent.Name ~= LocalPlayer.Name then
  316. if what.Parent:findFirstChild'Torso' and what.Parent:findFirstChild'Head' then
  317. what:Destroy()
  318. end
  319. end
  320. end)
  321. coroutine.wrap(function()
  322. FireBall = true
  323. humanoid.WalkSpeed = 0
  324. for i = 0,1,0.05 do
  325. a.Mesh.Scale = Vector3.new(i,i,i)
  326. wait()
  327. end
  328. FireBall = false
  329. humanoid.WalkSpeed = 16
  330. while wait() do
  331. if a == nil or a.Parent ~= workspace then break end
  332. a.CFrame = a.CFrame * CFrame.new(0,0,-1)
  333. end
  334. con:disconnect()
  335. end)()
  336. coroutine.wrap(function()
  337. wait(5)
  338. Instance.new("Explosion",workspace).Position = a.Position
  339. a:Destroy()
  340. end)()
  341. end
  342. function __Spikes()
  343. if Regening == true then return end
  344. if Energy < 25 then return end
  345. if Spikes == true then return end
  346. if ForceField == true then return end
  347. Energy = Energy - 25
  348. Spikes = true
  349. humanoid.WalkSpeed = 0
  350. for z = 0,6 do
  351. local a = Instance.new("Part",workspace)
  352. a.FormFactor = 'Custom'
  353. a.Size = Vector3.new(2.4, 3.4, 2.4)
  354. a.Anchored = true
  355. local b = Instance.new("SpecialMesh",a)
  356. b.MeshId = 'http://www.roblox.com/asset/?id=1033714'
  357. b.TextureId = 'http://www.roblox.com/asset?id=39251676'
  358. b.VertexColor = Vector3.new(1, 1, 1)
  359. b.Scale = Vector3.new(1.2, 5.4, 1.2)
  360. a.CFrame = LocalPlayer.Character.Torso.CFrame * CFrame.new(0,-0.5,-(z*4)-2)
  361. local con = a.Touched:connect(function(what)
  362. if what.Parent.Name ~= LocalPlayer.Name then
  363. if what.Parent:findFirstChild'Torso' and what.Parent:findFirstChild'Head' then
  364. for i,v in pairs(what.Parent:children()) do
  365. if v.ClassName == 'Humanoid' then
  366. if v.Health > 100 then v.Health = 100 end
  367. v.Health = v.Health - 10
  368. end
  369. end
  370. end
  371. end
  372. end)
  373. coroutine.wrap(function()
  374. wait(3)
  375. a:Destroy()
  376. con:disconnect()
  377. end)()
  378. wait()
  379. end
  380. humanoid.WalkSpeed = 16
  381. Spikes = false
  382. end
  383. function __Lightning()
  384. if Energy < 40 then return end
  385. if Lightning == true then return end
  386. if Regening == true then return end
  387. if ForceField == true then return end
  388. humanoid.WalkSpeed = 0
  389. Lightning = true
  390. Energy = Energy - 40
  391. local function segment(pos1,pos2,color)
  392. local dis=(pos1-pos2).magnitude
  393. local p=Instance.new("Part")
  394. p.CanCollide=false
  395. p.FormFactor="Custom"
  396. p.Size=Vector3.new(.2,.2,dis)
  397. p.Anchored=true
  398. p.CFrame=CFrame.new(pos1,pos2)*CFrame.new(0,0,-dis/2)
  399. p.BrickColor=color
  400. return p
  401. end
  402. target = mouse.Hit
  403. height=200
  404. prev=(target*CFrame.new(0,300,0)).p
  405. for i=height,30,-50 do
  406. cur=Vector3.new(math.random(15)+target.x,i,math.random(15)+target.z)
  407. p=segment(prev,cur,BrickColor.new("New Yeller"))
  408. p.Parent=workspace
  409. game:service("Debris"):AddItem(p,3)
  410. prev=cur
  411. wait()
  412. end
  413. p=segment(prev,target.p,BrickColor.new("New Yeller"))
  414. p.Parent=workspace
  415. game:service("Debris"):AddItem(p,3)
  416. Instance.new("Explosion",workspace).Position=target.p
  417. wait(1)
  418. Lightning = false
  419. humanoid.WalkSpeed = 16
  420. end
  421. function __ManaExplosion()
  422. if Energy < 100 then return end
  423. if ManaExplosion == true then return end
  424. if Regening == true then return end
  425. if ForceField == true then return end
  426. humanoid.WalkSpeed = 0
  427. ManaExplosion = true
  428. Energy = Energy - 100
  429. local Fire = Instance.new("Fire",LocalPlayer.Character.Torso)
  430. for i = 0,100 do
  431. Fire.Size = i
  432. wait()
  433. end
  434. Fire:remove()
  435. local a = Instance.new("Explosion", LocalPlayer.Character)
  436. a.Position = LocalPlayer.Character.Torso.Position
  437. a.BlastPressure = 1e100
  438. a.BlastRadius = 1e100
  439. ManaExplosion = false
  440. humanoid.WalkSpeed = 16
  441. end
  442. function __ForceField()
  443. if Energy < 45 then return end
  444. if ManaExplosion == true then return end
  445. if Regening == true then return end
  446. if ForceField == true then return end
  447. ForceField = true
  448. humanoid.WalkSpeed = 0
  449. Energy = Energy - 45
  450. local Force_Field = Instance.new('Part',LocalPlayer.Character.Torso)
  451. Force_Field.CFrame = LocalPlayer.Character['Left Leg'].CFrame
  452. Force_Field.Transparency = 0.7
  453. Force_Field.TopSurface = 0
  454. Force_Field.BottomSurface = 0
  455. Force_Field.Anchored = true
  456. Force_Field.Shape = 'Ball'
  457. Force_Field.FormFactor = 'Custom'
  458. Force_Field.CanCollide = false
  459. Force_Field.BrickColor = BrickColor.new('Deep blue')
  460. local FF_Mesh = Instance.new('SpecialMesh',Force_Field)
  461. FF_Mesh.MeshType = 'Sphere'
  462. FF_Mesh.Scale = Vector3.new(0,0,0)
  463. Force_Field.Touched:connect(function(what)
  464. print(what.Name)
  465. print(what.Parent.Name)
  466. if what.Parent.Name ~= LocalPlayer.Name then
  467. if what.Parent:findFirstChild'Torso' and what.Parent:findFirstChild'Head' then
  468. for i,v in pairs(what.Parent:children()) do
  469. if v.ClassName == 'Humanoid' then
  470. if v.Health > 100 then v.Health = 100 end
  471. v.Health = v.Health - 10
  472. end
  473. end
  474. end
  475. end
  476. end)
  477. for i = 0,15,0.1 do
  478. FF_Mesh.Scale = Vector3.new(i,i,i)
  479. wait()
  480. end
  481. for i = 15,0,-0.1 do
  482. FF_Mesh.Scale = Vector3.new(i,i,i)
  483. wait()
  484. end
  485. Force_Field:remove()
  486. humanoid.WalkSpeed = 16
  487. ForceField = false
  488. end
  489. t.Activated:connect(__onActivated)
  490. t.Deactivated:connect(__onDeactivated)
  491. t.Equipped:connect(__onEquipped)
  492. t.Unequipped:connect(__onUnequipped)
  493. coroutine.wrap(function()
  494. while wait() do
  495. if Activated == true then
  496. if Mode == 'Shoot' then
  497. __Shoot()
  498. elseif Mode == 'FireBall' then
  499. __FireBall()
  500. elseif Mode == 'Spikes' then
  501. __Spikes()
  502. elseif Mode == 'Lightning' then
  503. __Lightning()
  504. elseif Mode == 'ManaExplosion' then
  505. __ManaExplosion()
  506. elseif Mode == 'ForceField' then
  507. __ForceField()
  508. end
  509. end
  510. if Regening == true then
  511. Energy = Energy + 5
  512. wait(1)
  513. end
  514. end
  515. end)()
  516. mouse.KeyDown:connect(function(key)
  517. if key == 'r' then
  518. humanoid.WalkSpeed = 0
  519. Regening = true
  520. end
  521. if key == 'c' then
  522. if Mode == 'Shoot' then
  523. Mode = 'FireBall'
  524. elseif Mode == 'FireBall' then
  525. Mode = 'Spikes'
  526. elseif Mode == 'Spikes' then
  527. Mode = 'Lightning'
  528. elseif Mode == 'Lightning' then
  529. Mode = 'ManaExplosion'
  530. elseif Mode == 'ManaExplosion' then
  531. Mode = 'ForceField'
  532. else
  533. Mode = 'Shoot'
  534. end
  535. end
  536. if key:byte() == 48 then
  537. humanoid.WalkSpeed = 50
  538. end
  539. end)
  540. mouse.KeyUp:connect(function(key)
  541. if key == 'r' then
  542. humanoid.WalkSpeed = 16
  543. Regening = false
  544. end
  545. if key:byte() == 48 then
  546. humanoid.WalkSpeed = 16
  547. end
  548. end)
  549. count = 0
  550. countspeed = 0.70
  551. humanoid.Died:connect(function()
  552. p.Parent = workspace
  553. p.Position = LocalPlayer.Character['Right Arm'].Position
  554. p.CanCollide = true
  555. game:service'Debris':AddItem(p,5)
  556. for i = Energy,0,-1 do
  557. Energy = i
  558. wait()
  559. TEXTLABEL.Text = "Mana: "..tostring(Energy)
  560. end
  561. end)
  562. coroutine.wrap(function()
  563. while wait() do
  564. if Energy > 100 then Energy = 100 end
  565. if Energy < 0 then Energy = 0 end
  566. TEXTLABEL.Text = "Mana: "..tostring(Energy)
  567. TEXTLABEL2.Text = "Health: "..tostring(math.floor(humanoid.Health))
  568. if Mode == 'Shoot' then
  569. TEXTLABEL3.Text = 'Spell: Star shoot (5 mana)'
  570. elseif Mode == 'FireBall' then
  571. TEXTLABEL3.Text = 'Spell: Fire ball (50 mana)'
  572. elseif Mode == 'Spikes' then
  573. TEXTLABEL3.Text = 'Spell: Spikes row (25 mana)'
  574. elseif Mode == 'Lightning' then
  575. TEXTLABEL3.Text = 'Spell: Lightning (40 mana)'
  576. elseif Mode == 'ManaExplosion' then
  577. TEXTLABEL3.Text = 'Spell: Mana explosion (100 mana) *KILLS EVERYTHING*'
  578. elseif Mode == 'ForceField' then
  579. TEXTLABEL3.Text = 'Spell: Force Field (45 mana)'
  580. end
  581. count = (count % 100) + countspeed
  582. angle = math.pi * math.sin(math.pi*2/100*count)
  583. local mg = Vector3.new(torso.Velocity.x, 0, torso.Velocity.z).magnitude
  584. if Vector3.new(0, torso.Velocity.y, 0).magnitude > 2 then
  585. countspeed = 8
  586. if Equipped == false then
  587. rm.C0 = rsc0 * CFrame.Angles(math.rad(150), 0, math.rad(0))
  588. else
  589. rm.C0 = rsc0 * CFrame.Angles(math.rad(90),0,0)
  590. end
  591. lm.C0 = lsc0 * CFrame.Angles(math.rad(150), 0, math.rad(0))
  592. rlegm.C0 = rlc0 * CFrame.Angles(math.rad(-10) + (-angle*0.05), 0, 0)
  593. llegm.C0 = llc0 * CFrame.Angles(math.rad(-10) + (-angle*0.05), 0, 0)
  594. neck.C0 = neckc0 * CFrame.Angles(math.rad(-10) + (-angle*0.05),0,0)
  595. rootpart.RootJoint.C0 = rootc0 * CFrame.Angles(0,0,0)
  596. wait()
  597. elseif Vector3.new(torso.Velocity.x, 0, torso.Velocity.z).magnitude < 2 then --stand
  598. if shooting then
  599. countspeed = 8
  600. rj.C0 = rootc0 * CFrame.Angles(0,0,math.rad(25))
  601. rlegm.C0 = rlc0 * CFrame.Angles(math.rad(5), -math.rad(25), 0) --right leg
  602. llegm.C0 = llc0 * CFrame.Angles(-math.rad(5), -math.rad(25), -0) --left leg
  603. lm.C0 = lsc0 * CFrame.Angles(-math.rad(30), 0, -math.rad(25)) --left arm
  604. rm.C0 = rsc0 * CFrame.Angles(math.rad(90)+angle*0.050, 0, 0) --right arm
  605. elseif Regening == true then
  606. if Energy == 100 then Regening = false end
  607. rj.C0 = rootc0 * CFrame.Angles(0,0,0)
  608. llegm.C0 = llc0 * CFrame.Angles(0,0,math.rad(-15))
  609. rlegm.C0 = rlc0 * CFrame.Angles(0,0,math.rad(15))
  610. lm.C0 = lsc0 * CFrame.new(0.5,0,0) * CFrame.Angles(math.rad(90),0,math.rad(20))
  611. rm.C0 = rsc0 * CFrame.new(-0.5,0,0) * CFrame.Angles(math.rad(90),0,math.rad(-20))
  612. neck.C0 = neckc0 * CFrame.Angles(math.rad(15),0,0)
  613. elseif FireBall == true then
  614. rj.C0 = rootc0 * CFrame.Angles(0,0,0)
  615. llegm.C0 = llc0 * CFrame.Angles(0,0,math.rad(-15))
  616. rlegm.C0 = rlc0 * CFrame.Angles(0,0,math.rad(15))
  617. lm.C0 = lsc0 * CFrame.new(0.5,0,0) * CFrame.Angles(math.rad(90),0,math.rad(10))
  618. rm.C0 = rsc0 * CFrame.new(-0.5,0,0) * CFrame.Angles(math.rad(90),0,math.rad(-10))
  619. neck.C0 = neckc0 * CFrame.Angles(math.rad(15),0,0)
  620. elseif Spikes == true then
  621. rj.C0 = rootc0 * CFrame.Angles(0,0,0)
  622. llegm.C0 = llc0 * CFrame.Angles(0,0,math.rad(-15))
  623. rlegm.C0 = rlc0 * CFrame.Angles(0,0,math.rad(15))
  624. lm.C0 = lsc0 * CFrame.new(0.5,0,0) * CFrame.Angles(math.rad(90),0,math.rad(10))
  625. rm.C0 = rsc0 * CFrame.new(-0.5,0,0) * CFrame.Angles(math.rad(90),0,math.rad(-10))
  626. neck.C0 = neckc0 * CFrame.Angles(math.rad(15),0,0)
  627. elseif Lightning == true then
  628. rj.C0 = rootc0 * CFrame.Angles(0,0,0)
  629. llegm.C0 = llc0 * CFrame.Angles(0,0,math.rad(-15))
  630. rlegm.C0 = rlc0 * CFrame.Angles(0,0,math.rad(15))
  631. lm.C0 = lsc0 * CFrame.new(0.5,0,0) * CFrame.Angles(math.rad(120),0,math.rad(10))
  632. rm.C0 = rsc0 * CFrame.new(-0.5,0,0) * CFrame.Angles(math.rad(120),0,math.rad(-10))
  633. neck.C0 = neckc0 * CFrame.Angles(math.rad(-15),0,0)
  634. elseif ManaExplosion == true then
  635. coroutine.wrap(function()
  636. for i = 0,360 do
  637. rj.C0 = rootc0 * CFrame.Angles(0,0,0)
  638. wait()
  639. end
  640. end)()
  641. llegm.C0 = llc0 * CFrame.Angles(0,0,math.rad(-15))
  642. rlegm.C0 = rlc0 * CFrame.Angles(0,0,math.rad(15))
  643. lm.C0 = lsc0 * CFrame.new(0.5,0,0) * CFrame.Angles(math.rad(120),0,math.rad(10))
  644. rm.C0 = rsc0 * CFrame.new(-0.5,0,0) * CFrame.Angles(math.rad(120),0,math.rad(-10))
  645. neck.C0 = neckc0 * CFrame.Angles(math.rad(-15),0,0)
  646. elseif ForceField == true then
  647. rj.C0 = rootc0 * CFrame.Angles(0,0,0)
  648. llegm.C0 = llc0 * CFrame.Angles(0,0,math.rad(-15))
  649. rlegm.C0 = rlc0 * CFrame.Angles(0,0,math.rad(15))
  650. lm.C0 = lsc0 * CFrame.new(0.5,0,0) * CFrame.Angles(math.rad(120),0,math.rad(10))
  651. rm.C0 = rsc0 * CFrame.new(-0.5,0,0) * CFrame.Angles(math.rad(120),0,math.rad(-10))
  652. neck.C0 = neckc0 * CFrame.Angles(math.rad(-15),0,0)
  653. else
  654. countspeed = 0.70-- this judges how fast idle animation goes
  655. rlegm.C0 = rlc0 * CFrame.Angles(0, 0, 0) --right leg
  656. llegm.C0 = llc0 * CFrame.Angles(0, 0, -0) --left leg
  657. lm.C0 = lsc0 * CFrame.Angles(-angle*0.050, 0, 0) --left arm
  658. if Equipped == false then
  659. rm.C0 = rsc0 * CFrame.Angles(angle*0.050, 0, 0) --right arm
  660. else
  661. rm.C0 = rsc0 * CFrame.Angles(math.rad(90),0,0)
  662. end
  663. neck.C0 = neckc0 * CFrame.Angles(-angle*0.025, 0, 0) --head
  664. rj.C0 = rootc0 * CFrame.Angles(-math.rad(1), 0, 0) --torso
  665. end
  666. elseif mg > 2 and mg < 40 then-- walk
  667. countspeed = 8-- this judges how fast the walk animation goes
  668. rlegm.C0 = rlc0 * CFrame.Angles(-angle*0.100, 0, 0)
  669. llegm.C0 = llc0 * CFrame.Angles(angle*0.100, 0, 0)
  670. neck.C0 = neckc0 * CFrame.Angles(0, 0, 0)
  671. lm.C0 = lsc0 * CFrame.Angles(-angle*0.100, 0, 0)
  672. if Equipped == false then
  673. rm.C0 = rsc0 * CFrame.Angles(angle*0.100, 0, 0)
  674. else
  675. rm.C0 = rsc0 * CFrame.Angles(math.rad(90),0,0)
  676. end
  677. rj.C0 = rootc0 * CFrame.Angles(0, 0, 0)
  678. elseif mg > 40 then--run
  679. countspeed = 8
  680. rlegm.C0 = rlc0 * CFrame.Angles(-angle*0.200, 0, 0)
  681. llegm.C0 = llc0 * CFrame.Angles(angle*0.200, 0, 0)
  682. neck.C0 = neckc0 * CFrame.Angles(math.rad(-40), 0, 0)
  683. lm.C0 = lsc0 * CFrame.Angles(-math.rad(50)-(angle*0.100), 0, 0)
  684. rm.C0 = rsc0 * CFrame.Angles(-math.rad(50)+(angle*0.100), 0, 0)
  685. rj.C0 = rootc0 * CFrame.Angles(math.rad(40), 0, (angle*0.100))
  686. end
  687. end
  688. end)()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement