niggernognignigger

Necromancer

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