Idirina

ncromAnCr

Jan 4th, 2018
170
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 27.19 KB | None | 0 0
  1. --[[
  2. Necromancer
  3. Control the rotting flesh of the long dead.
  4. --]]
  5.  
  6.  
  7. if script == nil then return end
  8.  
  9.  
  10. ModelName = "Necromancer"
  11. Player = Game.Players.LocalPlayer
  12. Selected = false
  13. Connected = false
  14. Button1Down = false
  15. CanUse = true
  16. Characters = {}
  17. Mana = math.huge
  18. ManaMax = 100
  19.  
  20.  
  21. function CheckPlayer()
  22. if Player.Character == nil then return false end
  23. 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
  24. if Player.Character.Humanoid.Health <= 0 then return false end
  25. return true
  26. end
  27.  
  28.  
  29. function SetAngle(Joint, Angle, Character)
  30. if Character == nil then return false end
  31. local Joints = {
  32. Character.Torso:FindFirstChild("Right Shoulder 2"),
  33. Character.Torso:FindFirstChild("Left Shoulder 2"),
  34. Character.Torso:FindFirstChild("Right Hip 2"),
  35. Character.Torso:FindFirstChild("Left Hip 2")
  36. }
  37. if Joints[Joint] == nil then return false end
  38. if Joint == 1 or Joint == 3 then
  39. Joints[Joint].DesiredAngle = Angle
  40. end
  41. if Joint == 2 or Joint == 4 then
  42. Joints[Joint].DesiredAngle = -Angle
  43. end
  44. end
  45.  
  46.  
  47. function ForceAngle(Joint, Angle, Character)
  48. if Character == nil then return false end
  49. local Joints = {
  50. Character.Torso:FindFirstChild("Right Shoulder 2"),
  51. Character.Torso:FindFirstChild("Left Shoulder 2"),
  52. Character.Torso:FindFirstChild("Right Hip 2"),
  53. Character.Torso:FindFirstChild("Left Hip 2")
  54. }
  55. if Joints[Joint] == nil then return false end
  56. if Joint == 1 or Joint == 3 then
  57. Joints[Joint].DesiredAngle = Angle
  58. Joints[Joint].CurrentAngle = Angle
  59. end
  60. if Joint == 2 or Joint == 4 then
  61. Joints[Joint].DesiredAngle = -Angle
  62. Joints[Joint].CurrentAngle = -Angle
  63. end
  64. end
  65.  
  66.  
  67. function SetSpeed(Joint, Speed, Character)
  68. if Character == nil then return false end
  69. local Joints = {
  70. Character.Torso:FindFirstChild("Right Shoulder 2"),
  71. Character.Torso:FindFirstChild("Left Shoulder 2"),
  72. Character.Torso:FindFirstChild("Right Hip 2"),
  73. Character.Torso:FindFirstChild("Left Hip 2")
  74. }
  75. if Joints[Joint] == nil then return false end
  76. Joints[Joint].MaxVelocity = Speed
  77. end
  78.  
  79.  
  80. function DisableLimb(Limb, Character)
  81. if Character == nil then return false end
  82. if Character:FindFirstChild("Torso") == nil then return false end
  83. local Joints = {
  84. Character.Torso:FindFirstChild("Right Shoulder"),
  85. Character.Torso:FindFirstChild("Left Shoulder"),
  86. Character.Torso:FindFirstChild("Right Hip"),
  87. Character.Torso:FindFirstChild("Left Hip")
  88. }
  89. local Limbs = {
  90. Character:FindFirstChild("Right Arm"),
  91. Character:FindFirstChild("Left Arm"),
  92. Character:FindFirstChild("Right Leg"),
  93. Character:FindFirstChild("Left Leg")
  94. }
  95. if Joints[Limb] == nil then return false end
  96. if Limbs[Limb] == nil then return false end
  97. local Joint = Instance.new("Motor6D")
  98. Joint.Parent = Character.Torso
  99. Joint.Part0 = Character.Torso
  100. Joint.Part1 = Limbs[Limb]
  101. if Limb == 1 then
  102. Joint.C0 = CFrame.new(1.5, 0.5, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(90), 0)
  103. Joint.C1 = CFrame.new(0, 0.5, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(90), 0)
  104. Joint.Name = "Right Shoulder 2"
  105. elseif Limb == 2 then
  106. Joint.C0 = CFrame.new(-1.5, 0.5, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(-90), 0)
  107. Joint.C1 = CFrame.new(0, 0.5, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(-90), 0)
  108. Joint.Name = "Left Shoulder 2"
  109. elseif Limb == 3 then
  110. Joint.C0 = CFrame.new(0.5, -1, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(90), 0)
  111. Joint.C1 = CFrame.new(0, 1, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(90), 0)
  112. Joint.Name = "Right Hip 2"
  113. elseif Limb == 4 then
  114. Joint.C0 = CFrame.new(-0.5, -1, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(-90), 0)
  115. Joint.C1 = CFrame.new(0, 1, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(-90), 0)
  116. Joint.Name = "Left Hip 2"
  117. end
  118. Joint.MaxVelocity = Joints[Limb].MaxVelocity
  119. Joint.CurrentAngle = Joints[Limb].CurrentAngle
  120. Joint.DesiredAngle = Joints[Limb].DesiredAngle
  121. Joints[Limb]:Remove()
  122. end
  123.  
  124.  
  125. function ResetLimbCFrame(Limb, Character)
  126. if Character == nil then return false end
  127. if Character.Parent == nil then return false end
  128. if Character:FindFirstChild("Torso") == nil then return false end
  129. local Joints = {
  130. Character.Torso:FindFirstChild("Right Shoulder 2"),
  131. Character.Torso:FindFirstChild("Left Shoulder 2"),
  132. Character.Torso:FindFirstChild("Right Hip 2"),
  133. Character.Torso:FindFirstChild("Left Hip 2")
  134. }
  135. local Limbs = {
  136. Character:FindFirstChild("Right Arm"),
  137. Character:FindFirstChild("Left Arm"),
  138. Character:FindFirstChild("Right Leg"),
  139. Character:FindFirstChild("Left Leg")
  140. }
  141. if Joints[Limb] == nil then return false end
  142. if Limbs[Limb] == nil then return false end
  143. if Limb == 1 then
  144. Joints[Limb].C0 = CFrame.new(1.5, 0.5, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(90), 0)
  145. Joints[Limb].C1 = CFrame.new(0, 0.5, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(90), 0)
  146. elseif Limb == 2 then
  147. Joints[Limb].C0 = CFrame.new(-1.5, 0.5, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(-90), 0)
  148. Joints[Limb].C1 = CFrame.new(0, 0.5, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(-90), 0)
  149. elseif Limb == 3 then
  150. Joints[Limb].C0 = CFrame.new(0.5, -1, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(90), 0)
  151. Joints[Limb].C1 = CFrame.new(0, 1, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(90), 0)
  152. elseif Limb == 4 then
  153. Joints[Limb].C0 = CFrame.new(-0.5, -1, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(-90), 0)
  154. Joints[Limb].C1 = CFrame.new(0, 1, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(-90), 0)
  155. end
  156. end
  157.  
  158.  
  159. function EnableLimb(Limb, Character)
  160. if Character == nil then return false end
  161. if Character:FindFirstChild("Torso") == nil then return false end
  162. local Joints = {
  163. Character.Torso:FindFirstChild("Right Shoulder 2"),
  164. Character.Torso:FindFirstChild("Left Shoulder 2"),
  165. Character.Torso:FindFirstChild("Right Hip 2"),
  166. Character.Torso:FindFirstChild("Left Hip 2")
  167. }
  168. local Limbs = {
  169. Character:FindFirstChild("Right Arm"),
  170. Character:FindFirstChild("Left Arm"),
  171. Character:FindFirstChild("Right Leg"),
  172. Character:FindFirstChild("Left Leg")
  173. }
  174. if Joints[Limb] == nil then return false end
  175. if Limbs[Limb] == nil then return false end
  176. if Limb == 1 then
  177. Joints[Limb].Name = "Right Shoulder"
  178. elseif Limb == 2 then
  179. Joints[Limb].Name = "Left Shoulder"
  180. elseif Limb == 3 then
  181. Joints[Limb].Name = "Right Hip"
  182. elseif Limb == 4 then
  183. Joints[Limb].Name = "Left Hip"
  184. end
  185. Animate = Character:FindFirstChild("Animate")
  186. if Animate == nil then return false end
  187. Animate = Animate:Clone()
  188. Character.Animate:Remove()
  189. Animate.Parent = Character
  190. end
  191.  
  192.  
  193. function Move(Type, Target, Position)
  194. for i, Character in pairs(Characters) do
  195. pcall(function() Character.Moving:Remove() end)
  196. if Type == 0 then
  197. pcall(function() Character.Humanoid:MoveTo(Character.Torso.Position, Character.Torso) end)
  198. else
  199. local Moving = Instance.new("Configuration", Character)
  200. Moving.Name = "Moving"
  201. local Source = ""
  202. if Type == 2 then
  203. function onTouched(Hit)
  204. if Character.Humanoid.Health <= 0 then return end
  205. local Humanoid = Hit.Parent:FindFirstChild("Humanoid") or Hit.Parent.Parent:FindFirstChild("Humanoid")
  206. if Humanoid.Parent == Player.Character or Humanoid.Parent:FindFirstChild("Zombie") ~= nil then return end
  207. if Hit.Parent:FindFirstChild("ForceField") == nil then
  208. if math.random(1, 50) == 1 then
  209. Hit:BreakJoints()
  210. local Sound = Instance.new("Sound", Character.Torso)
  211. Sound.SoundId = "http://www.roblox.com/Asset/?id=2801263"
  212. Sound.Volume = 1
  213. Sound.Pitch = math.random(500, 700) / 1000
  214. Sound:Play()
  215. game:GetService("Debris"):AddItem(Sound, 1)
  216. elseif Humanoid ~= nil then
  217. local tag = Instance.new("ObjectValue")
  218. tag.Name = "creator"
  219. tag.Value = Player
  220. tag.Parent = Humanoid
  221. Humanoid:TakeDamage(math.random() * 10)
  222. wait(0.1)
  223. tag:Remove()
  224. end
  225. end
  226. end
  227. local _, Connection1 = pcall(function() return Character["Left Arm"].Touched:connect(onTouched) end)
  228. local _, Connection2 = pcall(function() return Character["Right Arm"].Touched:connect(onTouched) end)
  229. Moving.Changed:connect(function(Property)
  230. if Property == "Parent" then
  231. Connection1:disconnect()
  232. Connection2:disconnect()
  233. end
  234. end)
  235. end
  236. end
  237. end
  238. end
  239.  
  240.  
  241. function onButton1Down(Mouse)
  242. if Button1Down == true then return end
  243. Button1Down = true
  244. if CheckPlayer() == false then return end
  245. if CanUse == true then
  246. CanUse = false
  247. SetSpeed(1, 0.15, Player.Character)
  248. SetAngle(1, math.rad(90), Player.Character)
  249. SetSpeed(2, 0.15, Player.Character)
  250. SetAngle(2, math.rad(90), Player.Character)
  251. wait(0.3)
  252. local Arm = math.random(1, 2) == 1 and true or false
  253. local First = true
  254. while (Button1Down == true or First == true) and Selected == true and CheckPlayer() == true do
  255. First = false
  256. pcall(function()
  257. Arm = not Arm
  258. --SoundToServer("Fire", "http://www.roblox.com/Asset/?id=10209897", 0.5, 1, false, Player.Character.Torso)
  259. Mana = math.max(Mana - 2, 0)
  260. local Bullet = Instance.new("Part", Workspace)
  261. Bullet.Name = "Bullet"
  262. Bullet.TopSurface = 0
  263. Bullet.BottomSurface = 0
  264. Bullet.Transparency = 0.5
  265. Bullet.BrickColor = BrickColor.new("Really black")
  266. Bullet.Locked = true
  267. Bullet.FormFactor = "Custom"
  268. Bullet.Size = Vector3.new(2, 2, 2)
  269. Bullet.CFrame = CFrame.new((Player.Character[(Arm == true and "Right" or "Left").. " Arm"].CFrame * CFrame.new(0, -4, 0)).p, Mouse.Hit.p)
  270. Bullet.Elasticity = 0
  271. Bullet.Friction = 0
  272. Instance.new("SpecialMesh", Bullet).MeshType = "Sphere"
  273. tagHumanoid(Bullet)
  274. local BodyVelocity = Instance.new("BodyVelocity", Bullet)
  275. BodyVelocity.maxForce = Vector3.new(math.huge, math.huge, math.huge)
  276. BodyVelocity.velocity = ((Mouse.Hit.p - Player.Character[(Arm == true and "Right" or "Left").. " Arm"].Position).unit * 50) + Vector3.new(math.random(-400, 400) / 1000, math.random(-400, 400) / 1000, math.random(-400, 400) / 1000)
  277. game:GetService("Debris"):AddItem(Bullet, 5)
  278. Source.Touched:connect(function(Hit)
  279. if Hit.Name == "Shadow" then return end
  280. local Humanoid = Hit.Parent:FindFirstChild("Humanoid") or Hit.Parent.Parent:FindFirstChild("Humanoid")
  281. if Humanoid ~= nil and Humanoid.Parent:FindFirstChild("Zombie") == nil then
  282. local creator = Source.creator:Clone()
  283. local creator = creator:Clone()
  284. creator.Parent = Humanoid
  285. Humanoid:TakeDamage(15)
  286. if Humanoid.Health <= 0 then
  287. for _, Character in pairs(Characters) do
  288. pcall(function()
  289. Character.Humanoid.Health = Character.Humanoid.Health + 30
  290. end)
  291. end
  292. Mana = math.min(Mana + (Humanoid.MaxHealth / 5))
  293. end
  294. coroutine.wrap(function() wait(0.1) creator:Remove() end)()
  295. local Sound = Instance.new("Sound", Hit.Parent)
  296. Sound.Name = "Drain"
  297. Sound.SoundId = "http://www.roblox.com/Asset/?id=2785493"
  298. Sound.Pitch = 2
  299. Sound.Volume = 1
  300. Sound:Play()
  301. game:GetService("Debris"):AddItem(Sound, 1)
  302. for i = 1, 10 do
  303. local Shadow = Source:Clone()
  304. Shadow.Name = "Shadow"
  305. Shadow.Parent = Workspace
  306. Shadow.Transparency = 1
  307. Shadow.Size = Vector3.new(1, 1, 1)
  308. Shadow.CFrame = Source.CFrame * CFrame.new(math.random(-2500, 2500) / 1000, math.random(-2500, 2500) / 1000, math.random(-2500, 2500) / 1000)
  309. Shadow.Anchored = true
  310. Shadow.CanCollide = false
  311. coroutine.wrap(function()
  312. wait(math.random() / 2)
  313. for x = 1, 0, -0.1 do
  314. Shadow.Mesh.Scale = (Vector3.new(3, 3, 3) * x) + Vector3.new(0.5, 0.5, 0.5)
  315. Shadow.Transparency = x
  316. wait()
  317. end
  318. Shadow.Anchored = false
  319. while true do
  320. if pcall(function() if (Target.Position - Shadow.Position).magnitude < 3 then error() end end) == false then break end
  321. pcall(function() Shadow.BodyVelocity.velocity = ((Target.Position - Shadow.Position).unit * 50) end)
  322. wait()
  323. end
  324. local Sound = Instance.new("Sound", Target)
  325. Sound.Name = "Charge"
  326. Sound.SoundId = "http://www.roblox.com/Asset/?id=2101137"
  327. Sound.Pitch = 5
  328. Sound.Volume = 0.1
  329. Sound:Play()
  330. Mana = math.min(Mana + math.random(0, 2), ManaMax)
  331. Player.Character.Humanoid.Health = Player.Character.Humanoid.Health + math.random(0, 3)
  332. Shadow.BodyVelocity:Remove()
  333. Shadow.Anchored = true
  334. Shadow.CFrame = Target.CFrame * CFrame.new(math.random(-1000, 1000) / 1000, math.random(-1000, 1000) / 1000, math.random(-1000, 1000) / 1000)
  335. for x = 0, 1, 0.1 do
  336. Shadow.Anchored = true
  337. Shadow.Mesh.Scale = (Vector3.new(2, 2, 2) * x) + Vector3.new(0.5, 0.5, 0.5)
  338. Shadow.Transparency = x
  339. wait()
  340. end
  341. Shadow:Remove()
  342. end)()
  343. end
  344. else
  345. if Hit:GetMass() < 500 and Hit.Anchored == false and Humanoid == nil then
  346. Hit:BreakJoints()
  347. Hit.Velocity = Source.Velocity / 2
  348. end
  349. local Shadow = Source:Clone()
  350. Shadow.Name = "Shadow"
  351. Shadow.Parent = Workspace
  352. Shadow.Size = Vector3.new(1, 1, 1)
  353. Shadow.CFrame = Source.CFrame
  354. Shadow.Anchored = true
  355. Shadow.CanCollide = false
  356. coroutine.wrap(function()
  357. for x = 0, 1, 0.1 do
  358. Shadow.Mesh.Scale = (Vector3.new(2, 2, 2) * x) + Vector3.new(2, 2, 2)
  359. Shadow.Transparency = 0.5 + (x / 2)
  360. wait()
  361. end
  362. Shadow:Remove()
  363. end)()
  364. end
  365. Source:Remove()
  366. end)
  367. end)
  368. SetAngle(Arm == true and 1 or 2, math.rad(150), Player.Character)
  369.  
  370. wait(0.5)
  371. SetAngle(Arm == true and 1 or 2, math.rad(90), Player.Character)
  372. end
  373. wait(0.1)
  374. SetAngle(1, 0, Player.Character)
  375. SetAngle(2, 0, Player.Character)
  376. wait(0.2)
  377. CanUse = true
  378. end
  379. end
  380.  
  381.  
  382. function onButton1Up(Mouse)
  383. Button1Down = false
  384. end
  385.  
  386.  
  387. function onKeyDown(Key, Mouse)
  388. if Selected == false then return end
  389. Key = Key:lower()
  390. if Button1Down == false and CanUse == true and CheckPlayer() == true then
  391. if Key == "q" then
  392. if Mana < 30 then return end
  393. CanUse = false
  394. --SoundToServer("Charge", "http://www.roblox.com/Asset/?id=2101137", 0.4, 1, false, Player.Character.Torso)
  395. Mana = Mana - 30
  396. SetSpeed(1, 0.05, Player.Character)
  397. SetAngle(1, math.rad(-20), Player.Character)
  398. SetSpeed(2, 0.05, Player.Character)
  399. SetAngle(2, math.rad(-20), Player.Character)
  400. for i = 0, 1, 0.1 do
  401. pcall(function() Player.Character.Torso.Neck.C0 = CFrame.new(0, 1, 0) * CFrame.fromEulerAnglesXYZ(math.rad(-90 - (20 * i)), 0, math.rad(180)) end)
  402. wait()
  403. end
  404. for i = 1, 3 do
  405. local Color = math.random(1, 6)
  406. if Color == 1 then
  407. Color = BrickColor.new("Olive")
  408. elseif Color == 2 then
  409. Color = BrickColor.new("Br. yellowish green")
  410. elseif Color == 3 then
  411. Color = BrickColor.new("Grime")
  412. elseif Color == 4 then
  413. Color = BrickColor.new("Medium green")
  414. elseif Color == 5 then
  415. Color = BrickColor.new("Dark green")
  416. elseif Color == 6 then
  417. Color = BrickColor.new("Camo")
  418. end
  419. local SkinColor = Player.Character["Body Colors"].HeadColor
  420. local Character = Instance.new("Model", Workspace)
  421. Character.Name = Player.Name.. "'s Zombie"
  422. Instance.new("Configuration", Character).Name = "Zombie"
  423. local Head = Instance.new("Part", Character)
  424. Head.Name = "Head"
  425. Head.BrickColor = Color
  426. Head.FormFactor = 0
  427. Head.Size = Vector3.new(2, 1, 1)
  428. Head.TopSurface = 0
  429. Head.BottomSurface = "Weld"
  430. local Mesh = Instance.new("SpecialMesh", Head)
  431. Mesh.MeshType = "Head"
  432. Mesh.Scale = Vector3.new(1.25, 1.25, 1.25)
  433. local Face = Instance.new("Decal", Head)
  434. Face.Name = "face"
  435. Face.Face = "Front"
  436. Face.Texture = "rbxasset://textures/face.png"
  437. local Torso = Instance.new("Part", Character)
  438. Torso.Name = "Torso"
  439. Torso.BrickColor = Player.Character["Body Colors"].TorsoColor == SkinColor and Color or Player.Character["Body Colors"].TorsoColor
  440. Torso.FormFactor = 0
  441. Torso.Size = Vector3.new(2, 2, 1)
  442. Torso.TopSurface = "Studs"
  443. Torso.BottomSurface = "Inlet"
  444. Torso.LeftSurface = "Weld"
  445. Torso.RightSurface = "Weld"
  446. local TShirt = Instance.new("Decal", Torso)
  447. TShirt.Name = "roblox"
  448. TShirt.Face = "Front"
  449. local Limb = Instance.new("Part")
  450. Limb.FormFactor = 0
  451. Limb.Size = Vector3.new(1, 2, 1)
  452. Limb.TopSurface = "Studs"
  453. Limb.BottomSurface = "Inlet"
  454. Limb.BrickColor = BrickColor.new("Black")
  455. local LeftArm = Limb:Clone()
  456. LeftArm.Name = "Left Arm"
  457. LeftArm.BrickColor = Player.Character["Body Colors"].LeftArmColor == SkinColor and Color or Player.Character["Body Colors"].LeftArmColor
  458. LeftArm.Parent = Character
  459. local RightArm = Limb:Clone()
  460. RightArm.Name = "Right Arm"
  461. RightArm.BrickColor = Player.Character["Body Colors"].RightArmColor == SkinColor and Color or Player.Character["Body Colors"].RightArmColor
  462. RightArm.Parent = Character
  463. local LeftLeg = Limb:Clone()
  464. LeftLeg.Name = "Left Leg"
  465. LeftLeg.BrickColor = Player.Character["Body Colors"].LeftLegColor == SkinColor and Color or Player.Character["Body Colors"].LeftLegColor
  466. LeftLeg.Parent = Character
  467. local RightLeg = Limb:Clone()
  468. RightLeg.Name = "Right Leg"
  469. RightLeg.BrickColor = Player.Character["Body Colors"].RightLegColor == SkinColor and Color or Player.Character["Body Colors"].RightLegColor
  470. RightLeg.Parent = Character
  471. Character:BreakJoints()
  472. local Neck = Instance.new("Motor6D")
  473. Neck.Name = "Neck"
  474. Neck.Part0 = Torso
  475. Neck.Part1 = Head
  476. Neck.C0 = CFrame.new(0, 2, 0)
  477. Neck.C1 = CFrame.new(0, 0.5, 0)
  478. Neck.MaxVelocity = 0
  479. Neck.Parent = Torso
  480. local LeftShoulder = Instance.new("Motor6D", Torso)
  481. LeftShoulder.Name = "Left Shoulder"
  482. LeftShoulder.Part0 = Torso
  483. LeftShoulder.Part1 = LeftArm
  484. LeftShoulder.C0 = CFrame.new(-1.5, 0.5, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(-90), 0)
  485. LeftShoulder.C1 = CFrame.new(0, 0.5, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(-90), 0)
  486. LeftShoulder.MaxVelocity = 0.5
  487. local RightShoulder = Instance.new("Motor6D", Torso)
  488. RightShoulder.Name = "Right Shoulder"
  489. RightShoulder.Part0 = Torso
  490. RightShoulder.Part1 = RightArm
  491. RightShoulder.C0 = CFrame.new(1.5, 0.5, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(90), 0)
  492. RightShoulder.C1 = CFrame.new(0, 0.5, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(90), 0)
  493. RightShoulder.MaxVelocity = 0.5
  494. local LeftHip = Instance.new("Motor6D", Torso)
  495. LeftHip.Name = "Left Hip"
  496. LeftHip.Part0 = Torso
  497. LeftHip.Part1 = LeftLeg
  498. LeftHip.C0 = CFrame.new(-0.5, -1, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(-90), 0)
  499. LeftHip.C1 = CFrame.new(0, 1, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(-90), 0)
  500. LeftHip.MaxVelocity = 0.1
  501. local RightHip = Instance.new("Motor6D", Torso)
  502. RightHip.Name = "Right Hip"
  503. RightHip.Part0 = Torso
  504. RightHip.Part1 = RightLeg
  505. RightHip.C0 = CFrame.new(0.5, -1, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(90), 0)
  506. RightHip.C1 = CFrame.new(0, 1, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(90), 0)
  507. RightHip.MaxVelocity = 0.1
  508. local Humanoid = Instance.new("Humanoid")
  509. Humanoid.WalkSpeed = 20
  510. Humanoid.Parent = Character
  511. Humanoid.Died:connect(function()
  512. coroutine.wrap(function()
  513. for i, Part in pairs(Characters) do
  514. if Part == Character then
  515. table.remove(Characters, i)
  516. return
  517. end
  518. end
  519. end)()
  520. pcall(function() Character.Moving:Remove() end)
  521. wait(5)
  522. Character:Remove()
  523. end)
  524. for _, Part in pairs(Player.Character:GetChildren()) do
  525. if Part:IsA("Clothing") or Part.ClassName == "ShirtGraphic" or Part.ClassName == "BodyColors" or (Part:IsA("Accoutrement") and Part:FindFirstChild("Handle") ~= nil) then
  526. local Clone = Part:Clone()
  527. if Clone.ClassName == "BodyColors" then
  528. Clone.HeadColor = Character.Head.BrickColor
  529. Clone.TorsoColor = Character.Torso.BrickColor
  530. Clone.LeftArmColor = Character["Left Arm"].BrickColor
  531. Clone.RightArmColor = Character["Right Arm"].BrickColor
  532. Clone.LeftLegColor = Character["Left Leg"].BrickColor
  533. Clone.RightLegColor = Character["Right Leg"].BrickColor
  534. end
  535. Clone.Parent = Character
  536. end
  537. end
  538. coroutine.wrap(function() game:GetService("InsertService"):LoadAsset(55821959)["Animate"].Parent = Character end)()
  539. Torso.CFrame = Player.Character.Torso.CFrame * CFrame.new(0, -10, 0)
  540. SendToServer([[coroutine.wrap(function()
  541. local Angle = ]] ..((i / 3) * math.pi * 2).. [[
  542. Character.Torso.Anchored = true
  543. for i = -1, 0, 0.05 do
  544. Character.Torso.CFrame = Player.Character.Torso.CFrame * CFrame.new(math.sin(Angle) * 5, 0, math.cos(Angle) * 5) * CFrame.new(0, i * 6, 0)
  545. wait()
  546. end
  547. Character.Torso.Velocity = Vector3.new()
  548. Character.Torso.RotVelocity = Vector3.new()
  549. Character.Torso.Anchored = false
  550. Character.Torso.Velocity = Vector3.new()
  551. Character.Torso.RotVelocity = Vector3.new()
  552. end)()
  553. SoundObjects = {25954372, 25954392, 25954407, 24902268, 24902294}
  554. for i = 1, #SoundObjects do
  555. local Sound = Instance.new("Sound", Character.Head)
  556. Sound.SoundId = "http://www.roblox.com/Asset/?id=" ..SoundObjects[i]
  557. Sound.Volume = 1
  558. SoundObjects[i] = Sound
  559. end
  560. coroutine.wrap(function()
  561. while Character.Humanoid.Health > 0 do
  562. wait(math.random(1, 10))
  563. local i = math.random(1, #SoundObjects)
  564. SoundObjects[i].Pitch = math.random(8, 12) / 10
  565. SoundObjects[i]:Play()
  566. end
  567. end)()]], "Zombie Sounds", {"Player", Player, "Character", Character})
  568. table.insert(Characters, Character)
  569. end
  570. SetSpeed(1, 0.05, Player.Character)
  571. SetAngle(1, math.rad(140), Player.Character)
  572. SetSpeed(2, 0.05, Player.Character)
  573. SetAngle(2, math.rad(140), Player.Character)
  574. for i = 0, 1, 0.02 do
  575. pcall(function() Player.Character.Torso.Neck.C0 = CFrame.new(0, 1, 0) * CFrame.fromEulerAnglesXYZ(math.rad(-110 + (60 * i)), 0, math.rad(180)) end)
  576. wait()
  577. end
  578. SetSpeed(1, 0.15, Player.Character)
  579. SetAngle(1, 0, Player.Character)
  580. SetSpeed(2, 0.15, Player.Character)
  581. SetAngle(2, 0, Player.Character)
  582. for i = 0, 1, 0.1 do
  583. pcall(function() Player.Character.Torso.Neck.C0 = CFrame.new(0, 1, 0) * CFrame.fromEulerAnglesXYZ(math.rad(-50 - (40 * i)), 0, math.rad(180)) end)
  584. wait()
  585. end
  586. pcall(function() Player.Character.Torso.Neck.C0 = CFrame.new(0, 1, 0) * CFrame.fromEulerAnglesXYZ(math.rad(-90), 0, math.rad(180)) end)
  587. CanUse = true
  588. elseif Key == "e" or Key == "r" or Key == "t" or Key == "y" or Key == "u" then
  589. CanUse = false
  590. SetSpeed(1, 0.12, Player.Character)
  591. SetAngle(1, math.rad(90), Player.Character)
  592. SetSpeed(2, 0.12, Player.Character)
  593. SetAngle(2, math.rad(90), Player.Character)
  594. for i = 0, 1, 0.06 do
  595. pcall(function()
  596. Player.Character.Torso["Left Shoulder 2"].C0 = CFrame.new(-1.5, 0.5, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(-90 * (1 - i)), 0)
  597. Player.Character.Torso["Right Shoulder 2"].C0 = CFrame.new(1.5, 0.5, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(90 * (1 - i)), 0)
  598. end)
  599. wait()
  600. end
  601. pcall(function()
  602. Player.Character.Torso["Left Shoulder 2"].C0 = CFrame.new(-1.5, 0.5, 0)
  603. Player.Character.Torso["Right Shoulder 2"].C0 = CFrame.new(1.5, 0.5, 0)
  604. end)
  605. if Key == "e" then
  606. for _, Character in pairs(Characters) do
  607. pcall(function()
  608. Character.Humanoid.Health = 0
  609. Mana = math.min(Mana + 2, ManaMax)
  610. end)
  611. end
  612. Characters = {}
  613. elseif Key == "r" then
  614. Move(1)
  615. elseif Key == "t" then
  616. Move(2, Mouse.Target, Mouse.Hit.p)
  617. elseif Key == "y" then
  618. Move(0)
  619. elseif Key == "u" then
  620. for _, Character in pairs(Characters) do
  621. if Mana <= 3 then break end
  622. Mana = Mana - 3
  623. pcall(function()
  624. --SoundToServer("Charge", "http://www.roblox.com/Asset/?id=2101137", 2, 1, false, Character.Torso)
  625. Character.Humanoid.Health = Character.Humanoid.Health + 20
  626. local Shadow = Instance.new("Part", Workspace)
  627. Shadow.Name = "Shadow"
  628. Shadow.TopSurface = 0
  629. Shadow.BottomSurface = 0
  630. Shadow.Transparency = 0.5
  631. Shadow.BrickColor = BrickColor.new("Really black")
  632. Shadow.Locked = true
  633. Shadow.Anchored = true
  634. Shadow.CanCollide = false
  635. Shadow.FormFactor = "Custom"
  636. Shadow.Size = Vector3.new(4, 5, 4)
  637. Shadow.CFrame = Character.Torso.CFrame
  638. Shadow.Elasticity = 0
  639. Shadow.Friction = 0
  640. Instance.new("SpecialMesh", Shadow).MeshType = "Sphere"
  641. coroutine.wrap(function()
  642. for i = 0, 1, 0.1 do
  643. Shadow.Mesh.Scale = Vector3.new(1, 1, 1) + (Vector3.new(0.5, 0.5, 0.5) * i)
  644. Shadow.Transparency = 0.5 + (i * 0.5)
  645. wait()
  646. end
  647. Shadow:Remove()
  648. end)()
  649. end)
  650. wait(0.1)
  651. end
  652. end
  653. SetSpeed(1, 0.06, Player.Character)
  654. SetAngle(1, 0, Player.Character)
  655. SetSpeed(2, 0.06, Player.Character)
  656. SetAngle(2, 0, Player.Character)
  657. for i = 1, 0, -0.03 do
  658. pcall(function()
  659. Player.Character.Torso["Left Shoulder 2"].C0 = CFrame.new(-1.5, 0.5, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(-90 * (1 - i)), 0)
  660. Player.Character.Torso["Right Shoulder 2"].C0 = CFrame.new(1.5, 0.5, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(90 * (1 - i)), 0)
  661. end)
  662. wait()
  663. end
  664. ResetLimbCFrame(1, Player.Character)
  665. ResetLimbCFrame(2, Player.Character)
  666. CanUse = true
  667. end
  668. end
  669. end
  670.  
  671.  
  672. function onKeyUp(Key, Mouse)
  673. if Selected == false then return end
  674. Key = Key:lower()
  675. end
  676.  
  677.  
  678. function onSelected(Mouse)
  679. if Selected == true or CanUse == false then return end
  680. CanUse = false
  681. while true do
  682. if CheckPlayer() == true then
  683. if Player.Character.Torso:FindFirstChild("Right Shoulder") ~= nil and Player.Character.Torso:FindFirstChild("Left Shoulder") ~= nil then
  684. break
  685. end
  686. end
  687. wait(0.1)
  688. end
  689. Selected = true
  690. DisableLimb(1, Player.Character)
  691. SetSpeed(1, 0.5, Player.Character)
  692. SetAngle(1, 0, Player.Character)
  693. DisableLimb(2, Player.Character)
  694. SetSpeed(2, 0.5, Player.Character)
  695. SetAngle(2, 0, Player.Character)
  696. coroutine.wrap(function()
  697. while Selected == true do
  698. script.Parent.Name = "Mana:\n" ..Mana
  699. wait()
  700. end
  701. script.Parent.Name = ModelName
  702. end)()
  703. Mouse.Icon = "rbxasset://textures\\GunCursor.png"
  704. Mouse.Button1Down:connect(function() onButton1Down(Mouse) end)
  705. Mouse.Button1Up:connect(function() onButton1Up(Mouse) end)
  706. Mouse.KeyDown:connect(function(Key) onKeyDown(Key, Mouse) end)
  707. Mouse.KeyUp:connect(function(Key) onKeyUp(Key, Mouse) end)
  708. CanUse = true
  709. end
  710.  
  711.  
  712. function onDeselected(Mouse)
  713. if Selected == false then return end
  714. Selected = false
  715. while CanUse == false do wait() end
  716. ResetLimbCFrame(1, Player.Character)
  717. ResetLimbCFrame(2, Player.Character)
  718. SetSpeed(1, 0.25, Player.Character)
  719. SetSpeed(2, 0.25, Player.Character)
  720. EnableLimb(1, Player.Character)
  721. EnableLimb(2, Player.Character)
  722. CanUse = true
  723. end
  724.  
  725.  
  726. if script.Parent.ClassName ~= "HopperBin" then
  727. if Player == nil then print("Error: Player not found!") return end
  728. Tool = Instance.new("HopperBin")
  729. Tool.Name = ModelName
  730. Tool.Parent = Player.Backpack
  731. Instance.new("IntValue", script).Name = "Magazine"
  732. script.Name = "Main"
  733. script.Parent = Tool
  734. elseif script.Parent.ClassName == "HopperBin" and Connected == false then
  735. Connected = true
  736. Player = script.Parent.Parent.Parent
  737. end wait() if script.Parent.ClassName == "HopperBin" then
  738. while script.Parent.Parent.ClassName ~= "Backpack" do
  739. wait()
  740. end
  741. script.Parent.Selected:connect(onSelected)
  742. script.Parent.Deselected:connect(onDeselected)
  743. end
Add Comment
Please, Sign In to add comment