Dark_EccentricYT

Untitled

Jun 30th, 2018
167
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 36.43 KB | None | 0 0
  1. --[[
  2. Fire Mage
  3. Burn the resistors!
  4. --]]
  5.  
  6.  
  7. if script == nil then return end
  8.  
  9.  
  10. ModelName = "Fire Mage"
  11. Player = Game.Players.LocalPlayer
  12. Char = Player.Character
  13. animate = Char:findFirstChild("Animate")
  14. if animate then
  15. animate:Destroy()
  16. end
  17. Selected = false
  18. Connected = false
  19. Button1Down = false
  20. CanUse = true
  21. Mana = 100
  22. ManaMax = 100
  23.  
  24.  
  25.  
  26. function CheckPlayer()
  27. if Player.Character == nil then return false end
  28. if Player.Character:FindFirstChild("Torso") == nil or Player.Character:FindFirstChild("Right Arm") == nil or Player.Character:FindFirstChild("Left Arm") == nil or Player.Character:FindFirstChild("Humanoid") == nil then return false end
  29. if Player.Character.Humanoid.Health <= 0 then return false end
  30. return true
  31. end
  32.  
  33.  
  34. function tagHumanoid(humanoid)
  35. local tag = Instance.new("ObjectValue")
  36. tag.Name = "creator"
  37. tag.Value = Player
  38. tag.Parent = humanoid
  39. local tag = Instance.new("StringValue")
  40. tag.Name = "creatorType1"
  41. tag.Value = ModelName
  42. tag.Parent = humanoid
  43. local tag = Instance.new("StringValue")
  44. tag.Name = "creatorType2"
  45. tag.Value = "shot"
  46. tag.Parent = humanoid
  47. end
  48.  
  49.  
  50. function untagHumanoid(humanoid)
  51. if humanoid ~= nil then
  52. local tag = humanoid:FindFirstChild("creator")
  53. if tag ~= nil then
  54. tag:Remove()
  55. end
  56. local tag = humanoid:FindFirstChild("creatorType1")
  57. if tag ~= nil then
  58. tag:Remove()
  59. end
  60. local tag = humanoid:FindFirstChild("creatorType2")
  61. if tag ~= nil then
  62. tag:Remove()
  63. end
  64. end
  65. end
  66.  
  67.  
  68. function SetAngle(Joint, Angle, Character)
  69. if Character == nil then return false end
  70. local Joints = {
  71. Character.Torso:FindFirstChild("Right Shoulder 2"),
  72. Character.Torso:FindFirstChild("Left Shoulder 2"),
  73. Character.Torso:FindFirstChild("Right Hip 2"),
  74. Character.Torso:FindFirstChild("Left Hip 2")
  75. }
  76. if Joints[Joint] == nil then return false end
  77. if Joint == 1 or Joint == 3 then
  78. Joints[Joint].DesiredAngle = Angle
  79. end
  80. if Joint == 2 or Joint == 4 then
  81. Joints[Joint].DesiredAngle = -Angle
  82. end
  83. end
  84.  
  85.  
  86. function ForceAngle(Joint, Angle, Character)
  87. if Character == nil then return false end
  88. local Joints = {
  89. Character.Torso:FindFirstChild("Right Shoulder 2"),
  90. Character.Torso:FindFirstChild("Left Shoulder 2"),
  91. Character.Torso:FindFirstChild("Right Hip 2"),
  92. Character.Torso:FindFirstChild("Left Hip 2")
  93. }
  94. if Joints[Joint] == nil then return false end
  95. if Joint == 1 or Joint == 3 then
  96. Joints[Joint].DesiredAngle = Angle
  97. Joints[Joint].CurrentAngle = Angle
  98. end
  99. if Joint == 2 or Joint == 4 then
  100. Joints[Joint].DesiredAngle = -Angle
  101. Joints[Joint].CurrentAngle = -Angle
  102. end
  103. end
  104.  
  105.  
  106. function SetSpeed(Joint, Speed, Character)
  107. if Character == nil then return false end
  108. local Joints = {
  109. Character.Torso:FindFirstChild("Right Shoulder 2"),
  110. Character.Torso:FindFirstChild("Left Shoulder 2"),
  111. Character.Torso:FindFirstChild("Right Hip 2"),
  112. Character.Torso:FindFirstChild("Left Hip 2")
  113. }
  114. if Joints[Joint] == nil then return false end
  115. Joints[Joint].MaxVelocity = Speed
  116. end
  117.  
  118.  
  119. function DisableLimb(Limb, Character)
  120. if Character == nil then return false end
  121. if Character:FindFirstChild("Torso") == nil then return false end
  122. local Joints = {
  123. Character.Torso:FindFirstChild("Right Shoulder"),
  124. Character.Torso:FindFirstChild("Left Shoulder"),
  125. Character.Torso:FindFirstChild("Right Hip"),
  126. Character.Torso:FindFirstChild("Left Hip")
  127. }
  128. local Limbs = {
  129. Character:FindFirstChild("Right Arm"),
  130. Character:FindFirstChild("Left Arm"),
  131. Character:FindFirstChild("Right Leg"),
  132. Character:FindFirstChild("Left Leg")
  133. }
  134. if Joints[Limb] == nil then return false end
  135. if Limbs[Limb] == nil then return false end
  136. local Joint = Instance.new("Motor6D")
  137. Joint.Parent = Character.Torso
  138. Joint.Part0 = Character.Torso
  139. Joint.Part1 = Limbs[Limb]
  140. if Limb == 1 then
  141. Joint.C0 = CFrame.new(1.5, 0.5, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(90), 0)
  142. Joint.C1 = CFrame.new(0, 0.5, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(90), 0)
  143. Joint.Name = "Right Shoulder 2"
  144. elseif Limb == 2 then
  145. Joint.C0 = CFrame.new(-1.5, 0.5, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(-90), 0)
  146. Joint.C1 = CFrame.new(0, 0.5, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(-90), 0)
  147. Joint.Name = "Left Shoulder 2"
  148. elseif Limb == 3 then
  149. Joint.C0 = CFrame.new(0.5, -1, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(90), 0)
  150. Joint.C1 = CFrame.new(0, 1, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(90), 0)
  151. Joint.Name = "Right Hip 2"
  152. elseif Limb == 4 then
  153. Joint.C0 = CFrame.new(-0.5, -1, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(-90), 0)
  154. Joint.C1 = CFrame.new(0, 1, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(-90), 0)
  155. Joint.Name = "Left Hip 2"
  156. end
  157. Joint.MaxVelocity = Joints[Limb].MaxVelocity
  158. Joint.CurrentAngle = Joints[Limb].CurrentAngle
  159. Joint.DesiredAngle = Joints[Limb].DesiredAngle
  160. Joints[Limb]:Remove()
  161. end
  162.  
  163.  
  164. function ResetLimbCFrame(Limb, Character)
  165. if Character == nil then return false end
  166. if Character.Parent == nil then return false end
  167. if Character:FindFirstChild("Torso") == nil then return false end
  168. local Joints = {
  169. Character.Torso:FindFirstChild("Right Shoulder 2"),
  170. Character.Torso:FindFirstChild("Left Shoulder 2"),
  171. Character.Torso:FindFirstChild("Right Hip 2"),
  172. Character.Torso:FindFirstChild("Left Hip 2")
  173. }
  174. local Limbs = {
  175. Character:FindFirstChild("Right Arm"),
  176. Character:FindFirstChild("Left Arm"),
  177. Character:FindFirstChild("Right Leg"),
  178. Character:FindFirstChild("Left Leg")
  179. }
  180. if Joints[Limb] == nil then return false end
  181. if Limbs[Limb] == nil then return false end
  182. if Limb == 1 then
  183. Joints[Limb].C0 = CFrame.new(1.5, 0.5, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(90), 0)
  184. Joints[Limb].C1 = CFrame.new(0, 0.5, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(90), 0)
  185. elseif Limb == 2 then
  186. Joints[Limb].C0 = CFrame.new(-1.5, 0.5, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(-90), 0)
  187. Joints[Limb].C1 = CFrame.new(0, 0.5, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(-90), 0)
  188. elseif Limb == 3 then
  189. Joints[Limb].C0 = CFrame.new(0.5, -1, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(90), 0)
  190. Joints[Limb].C1 = CFrame.new(0, 1, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(90), 0)
  191. elseif Limb == 4 then
  192. Joints[Limb].C0 = CFrame.new(-0.5, -1, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(-90), 0)
  193. Joints[Limb].C1 = CFrame.new(0, 1, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(-90), 0)
  194. end
  195. end
  196.  
  197.  
  198. function EnableLimb(Limb, Character)
  199. if Character == nil then return false end
  200. if Character:FindFirstChild("Torso") == nil then return false end
  201. local Joints = {
  202. Character.Torso:FindFirstChild("Right Shoulder 2"),
  203. Character.Torso:FindFirstChild("Left Shoulder 2"),
  204. Character.Torso:FindFirstChild("Right Hip 2"),
  205. Character.Torso:FindFirstChild("Left Hip 2")
  206. }
  207. local Limbs = {
  208. Character:FindFirstChild("Right Arm"),
  209. Character:FindFirstChild("Left Arm"),
  210. Character:FindFirstChild("Right Leg"),
  211. Character:FindFirstChild("Left Leg")
  212. }
  213. if Joints[Limb] == nil then return false end
  214. if Limbs[Limb] == nil then return false end
  215. if Limb == 1 then
  216. Joints[Limb].Name = "Right Shoulder"
  217. elseif Limb == 2 then
  218. Joints[Limb].Name = "Left Shoulder"
  219. elseif Limb == 3 then
  220. Joints[Limb].Name = "Right Hip"
  221. elseif Limb == 4 then
  222. Joints[Limb].Name = "Left Hip"
  223. end
  224. Animate = Character:FindFirstChild("Animate")
  225. if Animate == nil then return false end
  226. Animate = Animate:Clone()
  227. Character.Animate:Remove()
  228. Animate.Parent = Character
  229. end
  230.  
  231.  
  232. function onButton1Down(Mouse)
  233. if Button1Down == true then return end
  234. Button1Down = true
  235. if CheckPlayer() == false then return end
  236. if CanUse == true then
  237. CanUse = false
  238. SetSpeed(1, 0.25, Player.Character)
  239. SetAngle(1, math.rad(90), Player.Character)
  240. SetSpeed(2, 0.25, Player.Character)
  241. SetAngle(2, math.rad(90), Player.Character)
  242. wait(0.3)
  243. local Arm = math.random(1, 2) == 1 and true or false
  244. local First = true
  245. while (Button1Down == true or First == true) and Selected == true and CheckPlayer() == true do
  246. if Mana <= 0 then break end
  247. First = false
  248. pcall(function()
  249. Arm = not Arm
  250. --SoundToServer("Fire", "http://www.roblox.com/Asset/?id=10209897", 1.5, 1, false, Player.Character.Torso)
  251. Mana = Mana - 2
  252. local Bullet = Instance.new("Part", Workspace)
  253. Bullet.Name = "Bullet"
  254. Bullet.TopSurface = 0
  255. Bullet.BottomSurface = 0
  256. Bullet.BrickColor = BrickColor.new("Really red")
  257. Bullet.Locked = true
  258. Bullet.FormFactor = "Custom"
  259. Bullet.Size = Vector3.new(0.5, 0.5, 1)
  260. Bullet.CFrame = CFrame.new((Player.Character[(Arm == true and "Right" or "Left").. " Arm"].CFrame * CFrame.new(0, -2.5, 0)).p, Mouse.Hit.p)
  261. Bullet.Elasticity = 0
  262. Bullet.Friction = 0
  263. BulletFire = Instance.new("Fire",Bullet)
  264. Instance.new("SpecialMesh", Bullet).MeshType = "Sphere"
  265. tagHumanoid(Bullet)
  266. local BodyVelocity = Instance.new("BodyVelocity", Bullet)
  267. BodyVelocity.maxForce = Vector3.new(math.huge, math.huge, math.huge)
  268. BodyVelocity.velocity = ((Mouse.Hit.p - Player.Character[(Arm == true and "Right" or "Left").. " Arm"].Position).unit * 150) + Vector3.new(math.random(-400, 400) / 1000, math.random(-400, 400) / 1000, math.random(-400, 400) / 1000)
  269. game:GetService("Debris"):AddItem(Bullet, 5)
  270. end)
  271. SetAngle(Arm == true and 1 or 2, math.rad(150), Player.Character)
  272. --CameraPunch(math.rad(math.random(-1000, 1000) / 1000), math.rad(math.random(-1000, 1000) / 1000))
  273. wait(0.15)
  274. SetAngle(Arm == true and 1 or 2, math.rad(90), Player.Character)
  275. wait(0.05)
  276. end
  277. wait(0.1)
  278. SetAngle(1, 0, Player.Character)
  279. SetAngle(2, 0, Player.Character)
  280. wait(0.2)
  281. CanUse = true
  282. end
  283. end
  284.  
  285.  
  286. function onButton1Up(Mouse)
  287. Button1Down = false
  288. end
  289.  
  290.  
  291. function onKeyDown(Key, Mouse)
  292. if Selected == false then return end
  293. Key = Key:lower()
  294. if Button1Down == false and CanUse == true and CheckPlayer() == true then
  295. if Key == "q" then
  296. if Mana < 25 then return end
  297. CanUse = false
  298. --SoundToServer("Charge", "http://www.roblox.com/Asset/?id=2101137", 0.5, 1, false, Player.Character.Torso)
  299. Mana = Mana - 25
  300. SetSpeed(1, 0.1, Player.Character)
  301. SetAngle(1, math.rad(90), Player.Character)
  302. SetSpeed(2, 0.1, Player.Character)
  303. SetAngle(2, math.rad(90), Player.Character)
  304. local Boulder = Instance.new("Part", Player.Character)
  305. Boulder.Name = "Boulder"
  306. Boulder.Locked = true
  307. Boulder.TopSurface = 0
  308. Boulder.BottomSurface = 0
  309. Boulder.BrickColor = BrickColor.new("Really red")
  310. Boulder.Material = "Concrete"
  311. Boulder.FormFactor = "Custom"
  312. Boulder.Size = Vector3.new(4, 4, 4)
  313. BoulderFire = Instance.new("Fire",Boulder)
  314. BoulderFire.Heat = 10
  315. Instance.new("SpecialMesh", Boulder).MeshType = "Sphere"
  316. local Weld = Instance.new("Weld", Player.Character.Torso)
  317. Weld.Part0 = Weld.Parent
  318. Weld.Part1 = Boulder
  319. Weld.C0 = CFrame.new(0, 0, -4)
  320. for i = 0, 1, 0.02 do
  321. Boulder.Mesh.Scale = Vector3.new(i, i, i)
  322. local Pebble = Instance.new("Part", Player.Character)
  323. Pebble.Name = "Pebble"
  324. Pebble.TopSurface = 0
  325. Pebble.BottomSurface = 0
  326. Pebble.BrickColor = BrickColor.new("Really red")
  327. Pebble.Material = "Concrete"
  328. Pebble.Locked = true
  329. Pebble.CanCollide = false
  330. Pebble.FormFactor = "Custom"
  331. Pebble.Size = Vector3.new(0.2 + (1 - i), 0.2 + (1 - i), 0.2 + (1 - i))
  332. PebbleFire = Instance.new("Fire",Pebble)
  333. Pebble.CFrame = Player.Character.Torso.CFrame * CFrame.new(math.random(-10000, 10000) / 1000, -5, -4 + math.random(-10000, 10000) / 1000)
  334. Instance.new("SpecialMesh", Pebble).MeshType = "Sphere"
  335. local BodyVelocity = Instance.new("BodyVelocity", Pebble)
  336. BodyVelocity.maxForce = Vector3.new(math.huge, math.huge, math.huge)
  337. coroutine.wrap(function()
  338. while Pebble.Parent ~= nil and Boulder.Parent ~= nil do
  339. if pcall(function() if (Boulder.Position - Pebble.Position).magnitude < math.random(1, 2) then error() end end) == false then break end
  340. pcall(function() BodyVelocity.velocity = ((Boulder.Position - Pebble.Position).unit * 30) end)
  341. wait()
  342. end
  343. Pebble:Remove()
  344. end)()
  345. wait()
  346. end
  347. wait(0.5)
  348. if pcall(function() return Mouse.Hit end) == true then
  349. --SoundToServer("Fire", "http://www.roblox.com/Asset/?id=10209268", 1, 1, false, Player.Character.Torso)
  350. Boulder:Remove()
  351. local Boulder = Boulder:Clone()
  352. Boulder.Transparency = 0
  353. Instance.new("SpecialMesh", Boulder).MeshType = "Sphere"
  354. local BodyVelocity = Instance.new("BodyVelocity", Boulder)
  355. BodyVelocity.maxForce = Vector3.new(math.huge, math.huge, math.huge)
  356. BodyVelocity.velocity = ((Mouse.Hit.p - Player.Character.Torso.Position).unit * 100)
  357. game:GetService("Debris"):AddItem(Boulder, 5)
  358. Boulder.Parent = Workspace
  359. SetSpeed(1, 0.25, Player.Character)
  360. SetAngle(1, math.rad(120), Player.Character)
  361. SetSpeed(2, 0.25, Player.Character)
  362. SetAngle(2, math.rad(120), Player.Character)
  363. --CameraPunch(math.rad(10), math.rad(math.random(-5000, 5000) / 1000))
  364. tagHumanoid(Boulder)
  365. wait(0.1)
  366.  
  367. wait(0.4)
  368. else
  369. Mana = Mana + 40
  370. --SoundToServer("Decharge", "http://www.roblox.com/Asset/?id=35275769", 1, 1, false, Player.Character.Torso)
  371. Boulder.Material = "Plastic"
  372. for i = 0, 1, 0.01 do
  373. Boulder.Transparency = i
  374. Boulder.Mesh.Scale = Vector3.new(1 - i, 1 - i, 1 - i)
  375. wait()
  376. end
  377. Boulder:Remove()
  378. end
  379. SetSpeed(1, 0.15, Player.Character)
  380. SetAngle(1, 0, Player.Character)
  381. SetSpeed(2, 0.15, Player.Character)
  382. SetAngle(2, 0, Player.Character)
  383. wait(1)
  384. CanUse = true
  385. elseif Key == "e" then
  386. CanUse = false
  387. KeyEDown = true
  388. SetSpeed(1, 0.06, Player.Character)
  389. SetAngle(1, math.rad(40), Player.Character)
  390. SetSpeed(2, 0.06, Player.Character)
  391. SetAngle(2, math.rad(40), Player.Character)
  392. --SoundToServer("Charge", "http://www.roblox.com/Asset/?id=2101144", 1.4, 1, false, Player.Character.Torso)
  393. for i = 0, 1, 0.09 do
  394. pcall(function()
  395. Player.Character.Torso.Neck.C0 = CFrame.new(0, 1, 0) * CFrame.fromEulerAnglesXYZ(math.rad(-90 + (40 * i)), 0, math.rad(180))
  396. Player.Character.Torso["Left Shoulder 2"].C0 = CFrame.new(-1.5 + (0.2 * i), 0.5, 0.2 * i) * CFrame.fromEulerAnglesXYZ(0, math.rad(-90 + (40 * i)), 0)
  397. Player.Character.Torso["Right Shoulder 2"].C0 = CFrame.new(1.5 - (0.2 * i), 0.5, 0.2 * i) * CFrame.fromEulerAnglesXYZ(0, math.rad(90 - (40 * i)), 0)
  398. end)
  399. wait()
  400. end
  401. pcall(function()
  402. Player.Character.Torso.Neck.C0 = CFrame.new(0, 1, 0) * CFrame.fromEulerAnglesXYZ(math.rad(-50), 0, math.rad(180))
  403. Player.Character.Torso["Left Shoulder 2"].C0 = CFrame.new(-1.3, 0.5, 0.2) * CFrame.fromEulerAnglesXYZ(0, math.rad(-50), 0)
  404. Player.Character.Torso["Right Shoulder 2"].C0 = CFrame.new(1.3, 0.5, 0.2) * CFrame.fromEulerAnglesXYZ(0, math.rad(50), 0)
  405. end)
  406. while KeyEDown == true and Selected == true and CheckPlayer() == true do
  407. local Pebble = Instance.new("Part", Player.Character)
  408. Pebble.Name = "Pebble"
  409. Pebble.TopSurface = 0
  410. Pebble.BottomSurface = 0
  411. Pebble.BrickColor = BrickColor.new("Really red")
  412. Pebble.Material = "Concrete"
  413. Pebble.Locked = true
  414. Pebble.CanCollide = false
  415. Pebble.FormFactor = "Custom"
  416. Pebble.Size = Vector3.new(0.3, 0.3, 0.3)
  417. Pebble.CFrame = CFrame.new(Player.Character.Torso.Position + Vector3.new(math.random(-10000, 10000) / 1000, -8, math.random(-10000, 10000) / 1000))
  418. Instance.new("SpecialMesh", Pebble).MeshType = "Sphere"
  419. local BodyVelocity = Instance.new("BodyVelocity", Pebble)
  420. BodyVelocity.maxForce = Vector3.new(math.huge, math.huge, math.huge)
  421. coroutine.wrap(function()
  422. local i = 0
  423. while true do
  424. i = i + 1
  425. if i > math.random(120, 350) or CheckPlayer() == false or KeyEDown == false then
  426. Pebble:Remove()
  427. return
  428. end
  429. if pcall(function() if (Player.Character.Torso.Position - Pebble.Position).magnitude < 1 then error() end end) == false then break end
  430. pcall(function() BodyVelocity.velocity = ((Player.Character.Torso.Position - Pebble.Position).unit * 10) end)
  431. wait()
  432. end
  433. if Mana < ManaMax then
  434. Mana = Mana + math.random(1, 3)
  435. else
  436. Mana = ManaMax
  437. pcall(function() Player.Character.Humanoid.Health = Player.Character.Humanoid.Health + 2 end)
  438. end
  439. --SoundToServer("Charge", "http://www.roblox.com/Asset/?id=2974249", 3, 1, false, Player.Character.Torso)
  440. Pebble.Anchored = true
  441. Pebble.Material = "Plastic"
  442. local OldPosition = CFrame.new(Pebble.Position)
  443. local OldSize = Pebble.Size
  444. for i = 0, 1, 0.1 do
  445. Pebble.Transparency = i
  446. Pebble.Size = OldSize + (Vector3.new(5, 5, 5) * i)
  447. Pebble.CFrame = OldPosition
  448. wait()
  449. end
  450. Pebble:Remove()
  451. end)()
  452. wait(0.1)
  453. end
  454. KeyEDown = false
  455. SetAngle(1, 0, Player.Character)
  456. SetAngle(2, 0, Player.Character)
  457. for i = 1, 0, -0.03 do
  458. pcall(function()
  459. Player.Character.Torso.Neck.C0 = CFrame.new(0, 1, 0) * CFrame.fromEulerAnglesXYZ(math.rad(-90 + (40 * i)), 0, math.rad(180))
  460. Player.Character.Torso["Left Shoulder 2"].C0 = CFrame.new(-1.5 + (0.2 * i), 0.5, 0.2 * i) * CFrame.fromEulerAnglesXYZ(0, math.rad(-90 + (40 * i)), 0)
  461. Player.Character.Torso["Right Shoulder 2"].C0 = CFrame.new(1.5 - (0.2 * i), 0.5, 0.2 * i) * CFrame.fromEulerAnglesXYZ(0, math.rad(90 - (40 * i)), 0)
  462. end)
  463. wait()
  464. end
  465. pcall(function() Player.Character.Torso.Neck.C0 = CFrame.new(0, 1, 0) * CFrame.fromEulerAnglesXYZ(math.rad(-90), 0, math.rad(180)) end)
  466. ResetLimbCFrame(1, Player.Character)
  467. ResetLimbCFrame(2, Player.Character)
  468. CanUse = true
  469. elseif Key == "r" then
  470. if Mana < 20 then return end
  471. CanUse = false
  472. Mana = Mana - 5
  473. SetSpeed(1, 0.015, Player.Character)
  474. SetAngle(1, math.rad(-40), Player.Character)
  475. SetSpeed(2, 0.015, Player.Character)
  476. SetAngle(2, math.rad(-40), Player.Character)
  477. --SoundToServer("Charge", "http://www.roblox.com/Asset/?id=1369158", 0.8, 1, false, Player.Character.Torso)
  478. for i = 0, 1, 0.03 do
  479. pcall(function() Player.Character.Torso.Neck.C0 = CFrame.new(0, 1, 0) * CFrame.fromEulerAnglesXYZ(math.rad(-90 - (40 * i)), 0, math.rad(180)) end)
  480. wait()
  481. end
  482. local Hit, Position = Workspace:FindPartOnRay(Ray.new((Player.Character.Torso.CFrame * CFrame.new(0, 0, -8)).p, Vector3.new(0, -1000, 0)), Player.Character)
  483. if Hit ~= nil and Position ~= nil then
  484. Mana = Mana - 15
  485. --SoundToServer("Fire", "http://www.roblox.com/Asset/?id=10209268", 0.6, 1, false, Player.Character.Torso)
  486. local Pillar = Instance.new("Part", Workspace)
  487. Pillar.Name = "Pillar"
  488. Pillar.TopSurface = 0
  489. Pillar.BottomSurface = 0
  490. Pillar.BrickColor = BrickColor.new("Really red")
  491. Pillar.Material = "Concrete"
  492. Pillar.Locked = true
  493. Pillar.Anchored = true
  494. Pillar.FormFactor = "Custom"
  495. Pillar.Size = Vector3.new(5, 100, 5)
  496. Pillar.CFrame = CFrame.new(Position, Vector3.new(Player.Character.Torso.Position.x, Position.y, Player.Character.Torso.Position.z)) * CFrame.new(math.random(-1000, 1000) / 1000, -35, (math.random(-1000, 1000) / 1000)) * CFrame.fromEulerAnglesXYZ(math.rad(math.random(-2000, 2000) / 1000), math.rad(math.random(-2000, 2000) / 1000), math.rad(math.random(-2000, 2000) / 1000))
  497. tagHumanoid(Pillar)
  498. wait(1)
  499. Pillar:remove()
  500.  
  501. end
  502. SetSpeed(1, 0.275, Player.Character)
  503. SetAngle(1, math.rad(160), Player.Character)
  504. SetSpeed(2, 0.275, Player.Character)
  505. SetAngle(2, math.rad(160), Player.Character)
  506. for i = 0, 1, 0.075 do
  507. pcall(function() Player.Character.Torso.Neck.C0 = CFrame.new(0, 1, 0) * CFrame.fromEulerAnglesXYZ(math.rad(-130 + (90 * i)), 0, math.rad(180)) end)
  508. wait()
  509. end
  510. pcall(function() Player.Character.Torso.Neck.C0 = CFrame.new(0, 1, 0) * CFrame.fromEulerAnglesXYZ(math.rad(-40), 0, math.rad(180)) end)
  511. wait(0.5)
  512. SetSpeed(1, 0.25, Player.Character)
  513. SetAngle(1, 0, Player.Character)
  514. SetSpeed(2, 0.25, Player.Character)
  515. SetAngle(2, 0, Player.Character)
  516. for i = 0, 1, 0.1 do
  517. pcall(function() Player.Character.Torso.Neck.C0 = CFrame.new(0, 1, 0) * CFrame.fromEulerAnglesXYZ(math.rad(-40 - (50 * i)), 0, math.rad(180)) end)
  518. wait()
  519. end
  520. pcall(function() Player.Character.Torso.Neck.C0 = CFrame.new(0, 1, 0) * CFrame.fromEulerAnglesXYZ(math.rad(-90), 0, math.rad(180)) end)
  521. CanUse = true
  522. elseif Key == "t" then
  523. if Mana < 15 then return end
  524. CanUse = false
  525. SetSpeed(1, 0.03, Player.Character)
  526. SetAngle(1, math.rad(-40), Player.Character)
  527. SetSpeed(2, 0.03, Player.Character)
  528. SetAngle(2, math.rad(-40), Player.Character)
  529. for i = 0, 1, 0.06 do
  530. pcall(function() Player.Character.Torso.Neck.C0 = CFrame.new(0, 1, 0) * CFrame.fromEulerAnglesXYZ(math.rad(-90 - (40 * i)), 0, math.rad(180)) end)
  531. wait()
  532. end
  533. local Hit, Position = Workspace:FindPartOnRay(Ray.new(Player.Character.Torso.Position, Vector3.new(0, -4, 0)), Player.Character)
  534. if Hit ~= nil and Position ~= nil then
  535. Mana = Mana - 15
  536. --SoundToServer("Fire", "http://www.roblox.com/Asset/?id=10209268", 2, 1, false, Player.Character.Torso)
  537. local Pillar = Instance.new("Part", Workspace)
  538. Pillar.Name = "Pillar"
  539. Pillar.TopSurface = 0
  540. Pillar.BottomSurface = 0
  541. Pillar.BrickColor = BrickColor.new("Pastel brown")
  542. Pillar.Material = "Concrete"
  543. Pillar.Locked = true
  544. Pillar.Anchored = true
  545. Pillar.FormFactor = "Custom"
  546. Pillar.Size = Vector3.new(2.5, 25, 2.5)
  547. Pillar.CFrame = CFrame.new(Position) * CFrame.new(0, -20, 0) * CFrame.fromEulerAnglesXYZ(Player.Character.Torso.CFrame:toEulerAnglesXYZ())
  548.  
  549. end
  550. SetSpeed(1, 0.3, Player.Character)
  551. SetAngle(1, math.rad(160), Player.Character)
  552. SetSpeed(2, 0.3, Player.Character)
  553. SetAngle(2, math.rad(160), Player.Character)
  554. for i = 0, 1, 0.09 do
  555. pcall(function() Player.Character.Torso.Neck.C0 = CFrame.new(0, 1, 0) * CFrame.fromEulerAnglesXYZ(math.rad(-130 + (90 * i)), 0, math.rad(180)) end)
  556. wait()
  557. end
  558. pcall(function() Player.Character.Torso.Neck.C0 = CFrame.new(0, 1, 0) * CFrame.fromEulerAnglesXYZ(math.rad(-40), 0, math.rad(180)) end)
  559. wait(0.25)
  560. SetSpeed(1, 0.25, Player.Character)
  561. SetAngle(1, 0, Player.Character)
  562. SetSpeed(2, 0.25, Player.Character)
  563. SetAngle(2, 0, Player.Character)
  564. for i = 0, 1, 0.1 do
  565. pcall(function() Player.Character.Torso.Neck.C0 = CFrame.new(0, 1, 0) * CFrame.fromEulerAnglesXYZ(math.rad(-40 - (50 * i)), 0, math.rad(180)) end)
  566. wait()
  567. end
  568. pcall(function() Player.Character.Torso.Neck.C0 = CFrame.new(0, 1, 0) * CFrame.fromEulerAnglesXYZ(math.rad(-90), 0, math.rad(180)) end)
  569. CanUse = true
  570. elseif Key == "y" then
  571. if Mana < 50 then return end
  572. CanUse = false
  573. Mana = Mana - 50
  574. SetSpeed(1, 0.1, Player.Character)
  575. SetAngle(1, math.rad(220), Player.Character)
  576. SetSpeed(2, 0.1, Player.Character)
  577. SetAngle(2, math.rad(220), Player.Character)
  578. --SoundToServer("Charge", "http://www.roblox.com/Asset/?id=1369158", 1, 1, false, Player.Character.Torso)
  579. for i = 0, 1, 0.025 do
  580. pcall(function() Player.Character.Torso.Neck.C0 = CFrame.new(0, 1, 0) * CFrame.fromEulerAnglesXYZ(math.rad(-90 + (40 * i)), 0, math.rad(180)) end)
  581. wait()
  582. end
  583. coroutine.wrap(function()
  584. local OldPosition = Player.Character.Torso.CFrame
  585. for i = 1, 50 do
  586. local Hit, Position = Workspace:FindPartOnRay(Ray.new((OldPosition * CFrame.new(0, 0, -8 - (i * 2))).p, Vector3.new(0, -50, 0)), Player.Character)
  587. if Hit ~= nil and Position ~= nil then
  588. local Pillar = Instance.new("Part", Workspace)
  589. Pillar.Name = "Pillar"
  590. Pillar.TopSurface = 0
  591. Pillar.BottomSurface = 0
  592. Pillar.BrickColor = BrickColor.new("Pastel brown")
  593. Pillar.Material = "Concrete"
  594. Pillar.Locked = true
  595. Pillar.Anchored = true
  596. Pillar.FormFactor = "Custom"
  597. Pillar.Size = Vector3.new(2, 5.5, 2)
  598. Pillar.CFrame = CFrame.new(Position) * CFrame.fromEulerAnglesXYZ(OldPosition:toEulerAnglesXYZ()) * CFrame.fromEulerAnglesXYZ(math.rad(-50), 0, 0) * CFrame.new(math.random(-500, 500) / 1000, -4, (math.random(-500, 500) / 1000)) * CFrame.fromEulerAnglesXYZ(math.rad(math.random(-1000, 1000) / 1000), math.rad(math.random(-1000, 1000) / 1000), math.rad(math.random(-1000, 1000) / 1000))
  599. --SoundToServer("Fire", "http://www.roblox.com/Asset/?id=10209268", 2, 1, false, Pillar)
  600. tagHumanoid(Pillar)
  601.  
  602. end
  603. wait()
  604. end
  605. end)()
  606. SetSpeed(1, 0.275, Player.Character)
  607. SetAngle(1, math.rad(-40), Player.Character)
  608. SetSpeed(2, 0.275, Player.Character)
  609. SetAngle(2, math.rad(-40), Player.Character)
  610. for i = 0, 1, 0.075 do
  611. pcall(function() Player.Character.Torso.Neck.C0 = CFrame.new(0, 1, 0) * CFrame.fromEulerAnglesXYZ(math.rad(-50 - (100 * i)), 0, math.rad(180)) end)
  612. wait()
  613. end
  614. pcall(function() Player.Character.Torso.Neck.C0 = CFrame.new(0, 1, 0) * CFrame.fromEulerAnglesXYZ(math.rad(-180), 0, math.rad(180)) end)
  615. wait(1)
  616. SetSpeed(1, 0.05, Player.Character)
  617. SetAngle(1, 0, Player.Character)
  618. SetSpeed(2, 0.05, Player.Character)
  619. SetAngle(2, 0, Player.Character)
  620. for i = 0, 1, 0.1 do
  621. pcall(function() Player.Character.Torso.Neck.C0 = CFrame.new(0, 1, 0) * CFrame.fromEulerAnglesXYZ(math.rad(-180 + (90 * i)), 0, math.rad(180)) end)
  622. wait()
  623. end
  624. pcall(function() Player.Character.Torso.Neck.C0 = CFrame.new(0, 1, 0) * CFrame.fromEulerAnglesXYZ(math.rad(-90), 0, math.rad(180)) end)
  625. CanUse = true
  626. elseif Key == "u" then
  627. if Mana < 100 then return end
  628. CanUse = false
  629. Mana = Mana - 100
  630. SetSpeed(1, 0.005, Player.Character)
  631. SetAngle(1, math.rad(-40), Player.Character)
  632. SetSpeed(2, 0.005, Player.Character)
  633. SetAngle(2, math.rad(-40), Player.Character)
  634. --SoundToServer("Charge", "http://www.roblox.com/Asset/?id=1369158", 0.5, 1, false, Player.Character.Torso)
  635. for i = 0, 1, 0.01 do
  636. pcall(function() Player.Character.Torso.Neck.C0 = CFrame.new(0, 1, 0) * CFrame.fromEulerAnglesXYZ(math.rad(-90 - (40 * i)), 0, math.rad(180)) end)
  637. wait()
  638. end
  639. local Hit, Position = Workspace:FindPartOnRay(Ray.new((Player.Character.Torso.CFrame * CFrame.new(0, 0, -15)).p, Vector3.new(0, -10, 0)), Player.Character)
  640. if Hit ~= nil and Position ~= nil then
  641. local Wave = Instance.new("Part", Workspace)
  642. Wave.Name = "Wave"
  643. Wave.TopSurface = 0
  644. Wave.BottomSurface = 0
  645. Wave.BrickColor = BrickColor.new("Pastel brown")
  646. Wave.Material = "Concrete"
  647. Wave.Locked = true
  648. Wave.Anchored = true
  649. Wave.FormFactor = "Custom"
  650. Wave.Size = Vector3.new(50, 20, 20)
  651. Wave.CFrame = CFrame.new(Position) * CFrame.new(0, -10, 0) * CFrame.fromEulerAnglesXYZ(Player.Character.Torso.CFrame:toEulerAnglesXYZ())
  652. Instance.new("SpecialMesh", Wave).MeshType = "Sphere"
  653. tagHumanoid(Wave)
  654.  
  655. coroutine.wrap(function()
  656. while Wave.Parent ~= nil do
  657. --SoundToServer("Fire", "http://www.roblox.com/Asset/?id=10209268", 0.5, 1, false, Wave)
  658. wait()
  659. end
  660. end)()
  661. end
  662. SetSpeed(1, 0.275, Player.Character)
  663. SetAngle(1, math.rad(160), Player.Character)
  664. SetSpeed(2, 0.275, Player.Character)
  665. SetAngle(2, math.rad(160), Player.Character)
  666. for i = 0, 1, 0.075 do
  667. pcall(function() Player.Character.Torso.Neck.C0 = CFrame.new(0, 1, 0) * CFrame.fromEulerAnglesXYZ(math.rad(-130 + (90 * i)), 0, math.rad(180)) end)
  668. wait()
  669. end
  670. pcall(function() Player.Character.Torso.Neck.C0 = CFrame.new(0, 1, 0) * CFrame.fromEulerAnglesXYZ(math.rad(-40), 0, math.rad(180)) end)
  671. wait(0.5)
  672. SetSpeed(1, 0.25, Player.Character)
  673. SetAngle(1, 0, Player.Character)
  674. SetSpeed(2, 0.25, Player.Character)
  675. SetAngle(2, 0, Player.Character)
  676. for i = 0, 1, 0.1 do
  677. pcall(function() Player.Character.Torso.Neck.C0 = CFrame.new(0, 1, 0) * CFrame.fromEulerAnglesXYZ(math.rad(-40 - (50 * i)), 0, math.rad(180)) end)
  678. wait()
  679. end
  680. pcall(function() Player.Character.Torso.Neck.C0 = CFrame.new(0, 1, 0) * CFrame.fromEulerAnglesXYZ(math.rad(-90), 0, math.rad(180)) end)
  681. CanUse = true
  682. elseif Key == "p" then
  683. if Mana < 30 then return end
  684. CanUse = false
  685. Mana = Mana - 30
  686. SetSpeed(1, 0.06, Player.Character)
  687. SetAngle(1, math.rad(90), Player.Character)
  688. SetSpeed(2, 0.06, Player.Character)
  689. SetAngle(2, math.rad(90), Player.Character)
  690. for i = 0, 1, 0.03 do
  691. pcall(function()
  692. Player.Character.Torso["Left Shoulder 2"].C0 = CFrame.new(-1.5, 0.5, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(-90 * (1 - i)), 0)
  693. Player.Character.Torso["Right Shoulder 2"].C0 = CFrame.new(1.5, 0.5, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(90 * (1 - i)), 0)
  694. end)
  695. wait()
  696. end
  697. pcall(function()
  698. Player.Character.Torso["Left Shoulder 2"].C0 = CFrame.new(-1.5, 0.5, 0)
  699. Player.Character.Torso["Right Shoulder 2"].C0 = CFrame.new(1.5, 0.5, 0)
  700. end)
  701. local OldPosition = Player.Character.Torso.CFrame
  702. for i = math.rad(-90), math.rad(90), math.rad(12.5) do
  703. local Hit, Position = Workspace:FindPartOnRay(Ray.new(OldPosition.p, Vector3.new(0, -4, 0)), Player.Character)
  704. if Hit ~= nil and Position ~= nil then
  705. --SoundToServer("Fire", "http://www.roblox.com/Asset/?id=10209268", 2, 1, false, Player.Character.Torso)
  706. local Pillar = Instance.new("Part", Workspace)
  707. Pillar.Name = "Pillar"
  708. Pillar.TopSurface = 0
  709. Pillar.BottomSurface = 0
  710. Pillar.BrickColor = BrickColor.new("Pastel brown")
  711. Pillar.Material = "Concrete"
  712. Pillar.Locked = true
  713. Pillar.Anchored = true
  714. Pillar.FormFactor = "Custom"
  715. Pillar.Size = Vector3.new(2.5, 8, 2.5)
  716. Pillar.CFrame = CFrame.new(Position) * CFrame.new(0, -5.5, 0) * CFrame.fromEulerAnglesXYZ(OldPosition:toEulerAnglesXYZ()) * CFrame.fromEulerAnglesXYZ(0, i, 0) * CFrame.new(0, 0, -10)
  717. end
  718. wait(0.1)
  719. end
  720. SetSpeed(1, 0.06, Player.Character)
  721. SetAngle(1, 0, Player.Character)
  722. SetSpeed(2, 0.06, Player.Character)
  723. SetAngle(2, 0, Player.Character)
  724. for i = 1, 0, -0.03 do
  725. pcall(function()
  726. Player.Character.Torso["Left Shoulder 2"].C0 = CFrame.new(-1.5, 0.5, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(-90 * (1 - i)), 0)
  727. Player.Character.Torso["Right Shoulder 2"].C0 = CFrame.new(1.5, 0.5, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(90 * (1 - i)), 0)
  728. end)
  729. wait()
  730. end
  731. ResetLimbCFrame(1, Player.Character)
  732. ResetLimbCFrame(2, Player.Character)
  733. CanUse = true
  734. elseif Key == "f" then
  735. if Mana <= 0 then return end
  736. CanUse = false
  737. KeyFDown = true
  738. SetSpeed(1, 0.06, Player.Character)
  739. SetAngle(1, math.rad(60), Player.Character)
  740. SetSpeed(2, 0.06, Player.Character)
  741. SetAngle(2, math.rad(60), Player.Character)
  742. local Boulder = Instance.new("Part", Player.Character)
  743. Boulder.Name = "Boulder"
  744. Boulder.Locked = true
  745. Boulder.TopSurface = 0
  746. Boulder.BottomSurface = 0
  747. Boulder.BrickColor = BrickColor.new("Pastel brown")
  748. Boulder.Material = "Concrete"
  749. Boulder.FormFactor = "Custom"
  750. Boulder.Size = Vector3.new(4, 0.5, 7)
  751. Boulder.CFrame = Player.Character.Torso.CFrame * CFrame.new(0, -3, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(90), 0)
  752. Instance.new("SpecialMesh", Boulder).MeshType = "Sphere"
  753. local Weld = Instance.new("Weld", Player.Character.Torso)
  754. Weld.Part0 = Weld.Parent
  755. Weld.Part1 = Boulder
  756. Weld.C0 = CFrame.new(0, -3, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(90), 0)
  757. local AimGyroAdd = Instance.new("CFrameValue", Player.Character)
  758. AimGyroAdd.Name = "AimGyroAdd"
  759. pcall(function() Player.Character.Torso.Neck.MaxVelocity = 0 end)
  760. for i = 0, 1, 0.07 do
  761. pcall(function() Boulder.Mesh.Scale = Vector3.new(i, i, i) end)
  762. pcall(function()
  763. Player.Character.Torso["Left Shoulder 2"].C0 = CFrame.new(-1.5, 0.5, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(-90 + (80 * i)), 0)
  764. Player.Character.Torso["Right Shoulder 2"].C0 = CFrame.new(1.5, 0.5, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(90 - (80 * i)), 0)
  765. Player.Character.Torso.Neck.CurrentAngle = math.rad(90 * i)
  766. end)
  767. AimGyroAdd.Value = CFrame.fromEulerAnglesXYZ(0, math.rad(-90 * i), 0)
  768. wait()
  769. end
  770. pcall(function() Boulder.Mesh.Scale = Vector3.new(1, 1, 1) end)
  771. pcall(function()
  772. Player.Character.Torso["Left Shoulder 2"].C0 = CFrame.new(-1.5, 0.5, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(-10), 0)
  773. Player.Character.Torso["Right Shoulder 2"].C0 = CFrame.new(1.5, 0.5, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(10), 0)
  774. end)
  775. local BodyVelocity = Instance.new("BodyVelocity", Boulder)
  776. BodyVelocity.maxForce = Vector3.new(math.huge, math.huge, math.huge)
  777. local BodyGyro = Instance.new("BodyGyro", Boulder)
  778. BodyGyro.P = 1000
  779. BodyGyro.D = 500
  780. BodyGyro.maxTorque = Vector3.new(math.huge, math.huge, math.huge)
  781. local i = 0
  782. local OldTick = math.huge
  783. while KeyFDown == true and Selected == true and Mana > 0 do
  784. if tick() % 1 <= OldTick then
  785. Mana = Mana - 1
  786. end
  787. OldTick = tick() % 1
  788. pcall(function() Player.Character.Humanoid.PlatformStand = true end)
  789. if (Boulder.Position - Mouse.Hit.p).magnitude <= 10 then
  790. i = i - 0.15
  791. else
  792. i = i + 0.05
  793. end
  794. if i < 0 then
  795. i = 0
  796. elseif i > 1 then
  797. i = 1
  798. end
  799. BodyGyro.cframe = CFrame.new(Boulder.Position, Mouse.Hit.p)
  800. BodyVelocity.velocity = Boulder.CFrame.lookVector * 50 * i
  801. wait()
  802. end
  803. pcall(function() Player.Character.Humanoid.PlatformStand = false end)
  804. BodyVelocity:Remove()
  805. BodyGyro:Remove()
  806. SetSpeed(1, 0.06, Player.Character)
  807. SetAngle(1, 0, Player.Character)
  808. SetSpeed(2, 0.06, Player.Character)
  809. SetAngle(2, 0, Player.Character)
  810. for i = 1, 0, -0.07 do
  811. pcall(function() Boulder.Mesh.Scale = Vector3.new(i, i, i) end)
  812. pcall(function()
  813. Player.Character.Torso["Left Shoulder 2"].C0 = CFrame.new(-1.5, 0.5, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(-90 + (80 * i)), 0)
  814. Player.Character.Torso["Right Shoulder 2"].C0 = CFrame.new(1.5, 0.5, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(90 - (80 * i)), 0)
  815. Player.Character.Torso.Neck.CurrentAngle = math.rad(90 * i)
  816. end)
  817. AimGyroAdd.Value = CFrame.fromEulerAnglesXYZ(0, math.rad(-90 * i), 0)
  818. wait()
  819. end
  820. Boulder:Remove()
  821. pcall(function() Player.Character.Torso.Neck.CurrentAngle = 0 end)
  822. AimGyroAdd:Remove()
  823. ResetLimbCFrame(1, Player.Character)
  824. ResetLimbCFrame(2, Player.Character)
  825. CanUse = true
  826. end
  827. end
  828. end
  829.  
  830.  
  831. function onKeyUp(Key, Mouse)
  832. if Selected == false then return end
  833. Key = Key:lower()
  834. if Key == "e" then
  835. KeyEDown = false
  836. elseif Key == "f" then
  837. KeyFDown = false
  838. end
  839. end
  840.  
  841.  
  842. function onSelected(Mouse)
  843. if Selected == true or CanUse == false then return end
  844. CanUse = false
  845. while true do
  846. if CheckPlayer() == true then
  847. if Player.Character.Torso:FindFirstChild("Right Shoulder") ~= nil and Player.Character.Torso:FindFirstChild("Left Shoulder") ~= nil then
  848. break
  849. end
  850. end
  851. wait(0.1)
  852. end
  853. Selected = true
  854. DisableLimb(1, Player.Character)
  855. SetSpeed(1, 0.5, Player.Character)
  856. SetAngle(1, 0, Player.Character)
  857. DisableLimb(2, Player.Character)
  858. SetSpeed(2, 0.5, Player.Character)
  859. SetAngle(2, 0, Player.Character)
  860. coroutine.wrap(function()
  861. while Selected == true do
  862. script.Parent.Name = "Mana:\n" ..Mana
  863. wait()
  864. end
  865. script.Parent.Name = ModelName
  866. end)()
  867. Mouse.Icon = "rbxasset://textures\\GunCursor.png"
  868. Mouse.Button1Down:connect(function() onButton1Down(Mouse) end)
  869. Mouse.Button1Up:connect(function() onButton1Up(Mouse) end)
  870. Mouse.KeyDown:connect(function(Key) onKeyDown(Key, Mouse) end)
  871. Mouse.KeyUp:connect(function(Key) onKeyUp(Key, Mouse) end)
  872. CanUse = true
  873. end
  874.  
  875.  
  876. function onDeselected(Mouse)
  877. if Selected == false then return end
  878. Selected = false
  879. while CanUse == false do wait() end
  880. ResetLimbCFrame(1, Player.Character)
  881. ResetLimbCFrame(2, Player.Character)
  882. SetSpeed(1, 0.25, Player.Character)
  883. SetSpeed(2, 0.25, Player.Character)
  884. EnableLimb(1, Player.Character)
  885. EnableLimb(2, Player.Character)
  886. CanUse = true
  887. end
  888.  
  889.  
  890. if script.Parent.ClassName ~= "HopperBin" then
  891. if Player == nil then print("Error: Player not found!") return end
  892. Tool = Instance.new("HopperBin")
  893. Tool.Name = ModelName
  894. Tool.Parent = Player.Backpack
  895. Instance.new("IntValue", script).Name = "Magazine"
  896. script.Name = "Main"
  897. script.Parent = Tool
  898. elseif script.Parent.ClassName == "HopperBin" and Connected == false then
  899. Connected = true
  900. Player = script.Parent.Parent.Parent
  901. end wait() if script.Parent.ClassName == "HopperBin" then
  902. while script.Parent.Parent.ClassName ~= "Backpack" do
  903. wait()
  904. end
  905. script.Parent.Selected:connect(onSelected)
  906. script.Parent.Deselected:connect(onDeselected)
  907. end
Add Comment
Please, Sign In to add comment