Advertisement
BobMe

ComCom

Jan 27th, 2018
145
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 46.64 KB | None | 0 0
  1. --com com--
  2. function sandbox(var,func)
  3. local env = getfenv(func)
  4. local newenv = setmetatable({},{
  5. __index = function(self,k)
  6. if k=="script" then
  7. return var
  8. else
  9. return env[k]
  10. end
  11. end,
  12. })
  13. setfenv(func,newenv)
  14. return func
  15. end
  16. cors = {}
  17. mas = Instance.new("Model",game:GetService("Lighting"))
  18. Model0 = Instance.new("Model")
  19. Part1 = Instance.new("Part")
  20. SpecialMesh2 = Instance.new("SpecialMesh")
  21. Decal3 = Instance.new("Decal")
  22. Script4 = Instance.new("Script")
  23. Script5 = Instance.new("Script")
  24. Weld6 = Instance.new("Weld")
  25. Weld7 = Instance.new("Weld")
  26. Part8 = Instance.new("Part")
  27. Motor6D9 = Instance.new("Motor6D")
  28. Motor6D10 = Instance.new("Motor6D")
  29. Weld11 = Instance.new("Weld")
  30. Weld12 = Instance.new("Weld")
  31. Script13 = Instance.new("Script")
  32. Part14 = Instance.new("Part")
  33. Script15 = Instance.new("Script")
  34. Part16 = Instance.new("Part")
  35. Weld17 = Instance.new("Weld")
  36. Script18 = Instance.new("Script")
  37. Part19 = Instance.new("Part")
  38. Script20 = Instance.new("Script")
  39. Part21 = Instance.new("Part")
  40. Script22 = Instance.new("Script")
  41. Humanoid23 = Instance.new("Humanoid")
  42. Hat24 = Instance.new("Hat")
  43. Part25 = Instance.new("Part")
  44. SpecialMesh26 = Instance.new("SpecialMesh")
  45. Script27 = Instance.new("Script")
  46. Part28 = Instance.new("Part")
  47. Sound29 = Instance.new("Sound")
  48. Sound30 = Instance.new("Sound")
  49. Script31 = Instance.new("Script")
  50. Script32 = Instance.new("Script")
  51. Hat33 = Instance.new("Hat")
  52. Part34 = Instance.new("Part")
  53. SpecialMesh35 = Instance.new("SpecialMesh")
  54. Part36 = Instance.new("Part")
  55. SpecialMesh37 = Instance.new("SpecialMesh")
  56. Script38 = Instance.new("Script")
  57. Pants39 = Instance.new("Pants")
  58. Shirt40 = Instance.new("Shirt")
  59. Script41 = Instance.new("Script")
  60. Script42 = Instance.new("Script")
  61. Script43 = Instance.new("Script")
  62. Model0.Name = "Communist"
  63. Model0.Parent = mas
  64. Model0.PrimaryPart = Part1
  65. Part1.Name = "Head"
  66. Part1.Parent = Model0
  67. Part1.BrickColor = BrickColor.new("Light orange")
  68. Part1.FormFactor = Enum.FormFactor.Symmetric
  69. Part1.Size = Vector3.new(2, 1, 1)
  70. Part1.CFrame = CFrame.new(-0.208322003, 4.5000391, 1.03549194, 0.999992847, -8.12661223e-12, -1.49012322e-08, 8.19073628e-12, 1, 3.69057996e-12, 1.49012322e-08, -3.75279755e-12, 0.999992847)
  71. Part1.TopSurface = Enum.SurfaceType.Smooth
  72. Part1.Color = Color3.new(0.917647, 0.721569, 0.572549)
  73. Part1.Position = Vector3.new(-0.208322003, 4.5000391, 1.03549194)
  74. Part1.Color = Color3.new(0.917647, 0.721569, 0.572549)
  75. SpecialMesh2.Parent = Part1
  76. SpecialMesh2.Scale = Vector3.new(1.25, 1.25, 1.25)
  77. SpecialMesh2.Scale = Vector3.new(1.25, 1.25, 1.25)
  78. Decal3.Parent = Part1
  79. Decal3.Texture = "http://www.roblox.com/asset/?id=221967384"
  80. Script4.Parent = Part1
  81. table.insert(cors,sandbox(Script4,function()
  82. function blow(hit)
  83. local humanoid = hit.Parent:findFirstChild("Humanoid")
  84.  
  85. if humanoid~=nil then
  86. humanoid:TakeDamage(25)
  87. end
  88. end
  89.  
  90.  
  91.  
  92. connection = script.Parent.Touched:connect(blow)
  93.  
  94.  
  95.  
  96. end))
  97. Script5.Name = "PlaySounds"
  98. Script5.Parent = Part1
  99. table.insert(cors,sandbox(Script5,function()
  100. zombieParent = false
  101.  
  102. local soundIds = {113306429,111896685,113306429}
  103. local sounds = {}
  104. for i=1,#soundIds do
  105. local s = Instance.new("Sound")
  106. s.SoundId = "http://www.roblox.com/asset/?id=" .. soundIds[i]
  107. s.Volume = 1
  108. s.Parent = script.Parent
  109. sounds[#sounds + 1] = s
  110. end
  111.  
  112. while zombieParent == false do
  113.  
  114. wait(1)
  115. if script.Parent.Name == "Head" then
  116. zombieParent = true
  117. end
  118.  
  119. end
  120.  
  121. while true do
  122. wait(math.random(20,35))
  123. local i = math.random(1, #sounds)
  124. sounds[i].Pitch = 1
  125. sounds[i]:Play()
  126. end
  127. end))
  128. Weld6.Name = "HeadWeld"
  129. Weld6.Parent = Part1
  130. Weld6.C0 = CFrame.new(0, 0.5, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  131. Weld6.C1 = CFrame.new(0, 0.349999994, 0, 1, 0, -0, 0, 0.995037258, 0.0995037109, 0, -0.0995037258, 0.995037138)
  132. Weld6.Part0 = Part1
  133. Weld6.Part1 = Part25
  134. Weld7.Name = "HeadWeld"
  135. Weld7.Parent = Part1
  136. Weld7.C0 = CFrame.new(0, 0.5, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  137. Weld7.C1 = CFrame.new(0, -0.100000001, 0, 1, 0, -0, 0, 0.995037258, 0.0995037109, 0, -0.0995037258, 0.995037138)
  138. Weld7.Part0 = Part1
  139. Weld7.Part1 = Part34
  140. Part8.Name = "Torso"
  141. Part8.Parent = Model0
  142. Part8.BrickColor = BrickColor.new("Light orange")
  143. Part8.FormFactor = Enum.FormFactor.Symmetric
  144. Part8.Size = Vector3.new(2, 2, 1)
  145. Part8.CFrame = CFrame.new(-0.208322003, 3.00003505, 1.03549194, 1, -8.16947031e-12, -1.49012678e-08, 8.16947031e-12, 1, 3.73059353e-12, 1.49012678e-08, -3.73059353e-12, 1)
  146. Part8.LeftSurface = Enum.SurfaceType.Weld
  147. Part8.RightSurface = Enum.SurfaceType.Weld
  148. Part8.Color = Color3.new(0.917647, 0.721569, 0.572549)
  149. Part8.Position = Vector3.new(-0.208322003, 3.00003505, 1.03549194)
  150. Part8.Color = Color3.new(0.917647, 0.721569, 0.572549)
  151. Motor6D9.Name = "Right Hip"
  152. Motor6D9.Parent = Part8
  153. Motor6D9.C0 = CFrame.new(1, -1, 0, 0, 0, 1, 0, 1, -0, -1, 0, 0)
  154. Motor6D9.C1 = CFrame.new(0.5, 1, 0, 0, 0, 1, 0, 1, -0, -1, 0, 0)
  155. Motor6D9.Part0 = Part8
  156. Motor6D9.Part1 = Part21
  157. Motor6D9.MaxVelocity = 0.10000000149012
  158. Motor6D10.Name = "Left Hip"
  159. Motor6D10.Parent = Part8
  160. Motor6D10.C0 = CFrame.new(-1, -1, 0, 0, 0, -1, 0, 1, 0, 1, 0, 0)
  161. Motor6D10.C1 = CFrame.new(-0.5, 1, 0, 0, 0, -1, 0, 1, 0, 1, 0, 0)
  162. Motor6D10.Part0 = Part8
  163. Motor6D10.Part1 = Part19
  164. Motor6D10.MaxVelocity = 0.10000000149012
  165. Weld11.Parent = Part8
  166. Weld11.C1 = CFrame.new(0.800000012, 0.5, 0.400000006, 0.766044438, 0, 0.642787576, -0.642787576, 1.19248806e-08, 0.766044438, -7.66516539e-09, -1, 9.13498877e-09)
  167. Weld11.Part0 = Part8
  168. Weld11.Part1 = Part14
  169. Weld12.Parent = Part8
  170. Weld12.C1 = CFrame.new(-1.20000005, 0.5, 0.400000006, 0.99619472, 0, -0.087155737, 0.087155737, 1.19248806e-08, 0.99619472, 1.03932174e-09, -1, 1.18795027e-08)
  171. Weld12.Part0 = Part8
  172. Weld12.Part1 = Part16
  173. Script13.Parent = Part8
  174. table.insert(cors,sandbox(Script13,function()
  175. function blow(hit)
  176. local humanoid = hit.Parent:findFirstChild("Humanoid")
  177.  
  178. if humanoid~=nil then
  179. humanoid:TakeDamage(25)
  180. end
  181. end
  182.  
  183.  
  184.  
  185. connection = script.Parent.Touched:connect(blow)
  186.  
  187.  
  188.  
  189. end))
  190. Part14.Name = "Left Arm"
  191. Part14.Parent = Model0
  192. Part14.BrickColor = BrickColor.new("Light orange")
  193. Part14.Rotation = Vector3.new(90, 0, 40)
  194. Part14.CanCollide = false
  195. Part14.FormFactor = Enum.FormFactor.Symmetric
  196. Part14.Size = Vector3.new(1, 2, 1)
  197. Part14.CFrame = CFrame.new(-0.499763787, 3.40003514, 0.138239622, 0.766044438, -0.642787576, -7.65699593e-09, 8.65615652e-12, 1.19224879e-08, -1, 0.642787576, 0.766044438, 9.13871911e-09)
  198. Part14.Color = Color3.new(0.917647, 0.721569, 0.572549)
  199. Part14.Position = Vector3.new(-0.499763787, 3.40003514, 0.138239622)
  200. Part14.Orientation = Vector3.new(90, -40, 0)
  201. Part14.Color = Color3.new(0.917647, 0.721569, 0.572549)
  202. Script15.Parent = Part14
  203. table.insert(cors,sandbox(Script15,function()
  204. function blow(hit)
  205. local humanoid = hit.Parent:findFirstChild("Humanoid")
  206.  
  207. if humanoid~=nil then
  208. humanoid:TakeDamage(25)
  209. end
  210. end
  211.  
  212.  
  213.  
  214. connection = script.Parent.Touched:connect(blow)
  215.  
  216.  
  217.  
  218. end))
  219. Part16.Name = "Right Arm"
  220. Part16.Parent = Model0
  221. Part16.BrickColor = BrickColor.new("Light orange")
  222. Part16.Rotation = Vector3.new(90, 0, -5)
  223. Part16.CanCollide = false
  224. Part16.FormFactor = Enum.FormFactor.Symmetric
  225. Part16.Size = Vector3.new(1, 2, 1)
  226. Part16.CFrame = CFrame.new(0.943533838, 3.40003514, 0.432807684, 0.99619472, 0.0871557221, 1.04749098e-09, 7.81324051e-12, 1.19293091e-08, -1, -0.0871557221, 0.99619472, 1.18832331e-08)
  227. Part16.Color = Color3.new(0.917647, 0.721569, 0.572549)
  228. Part16.Position = Vector3.new(0.943533838, 3.40003514, 0.432807684)
  229. Part16.Orientation = Vector3.new(90, 5, 0)
  230. Part16.Color = Color3.new(0.917647, 0.721569, 0.572549)
  231. Weld17.Name = "RightGrip"
  232. Weld17.Parent = Part16
  233. Weld17.C0 = CFrame.new(0, -1, 0, 1, 0, -0, 0, 0, 1, 0, -1, 0)
  234. Weld17.C1 = CFrame.new(0, -0.200000003, 0.200000003, 0, 0, -1, 0, 1, 0, 1, 0, 0)
  235. Weld17.Part0 = Part16
  236. Weld17.Part1 = Part28
  237. Script18.Parent = Part16
  238. table.insert(cors,sandbox(Script18,function()
  239. function blow(hit)
  240. local humanoid = hit.Parent:findFirstChild("Humanoid")
  241.  
  242. if humanoid~=nil then
  243. humanoid:TakeDamage(25)
  244. end
  245. end
  246.  
  247.  
  248.  
  249. connection = script.Parent.Touched:connect(blow)
  250.  
  251.  
  252.  
  253. end))
  254. Part19.Name = "Left Leg"
  255. Part19.Parent = Model0
  256. Part19.BrickColor = BrickColor.new("Light orange")
  257. Part19.CanCollide = false
  258. Part19.FormFactor = Enum.FormFactor.Symmetric
  259. Part19.Size = Vector3.new(1, 2, 1)
  260. Part19.CFrame = CFrame.new(-0.708321989, 1.00003505, 1.03549194, 1, -8.16947031e-12, -1.49012678e-08, 8.16947031e-12, 1, 3.73059353e-12, 1.49012678e-08, -3.73059353e-12, 1)
  261. Part19.BottomSurface = Enum.SurfaceType.Smooth
  262. Part19.Color = Color3.new(0.917647, 0.721569, 0.572549)
  263. Part19.Position = Vector3.new(-0.708321989, 1.00003505, 1.03549194)
  264. Part19.Color = Color3.new(0.917647, 0.721569, 0.572549)
  265. Script20.Parent = Part19
  266. table.insert(cors,sandbox(Script20,function()
  267. function blow(hit)
  268. local humanoid = hit.Parent:findFirstChild("Humanoid")
  269.  
  270. if humanoid~=nil then
  271. humanoid:TakeDamage(25)
  272. end
  273. end
  274.  
  275.  
  276.  
  277. connection = script.Parent.Touched:connect(blow)
  278.  
  279.  
  280.  
  281. end))
  282. Part21.Name = "Right Leg"
  283. Part21.Parent = Model0
  284. Part21.BrickColor = BrickColor.new("Light orange")
  285. Part21.CanCollide = false
  286. Part21.FormFactor = Enum.FormFactor.Symmetric
  287. Part21.Size = Vector3.new(1, 2, 1)
  288. Part21.CFrame = CFrame.new(0.291678011, 1.00003505, 1.03549194, 1, -8.16947031e-12, -1.49012678e-08, 8.16947031e-12, 1, 3.73059353e-12, 1.49012678e-08, -3.73059353e-12, 1)
  289. Part21.BottomSurface = Enum.SurfaceType.Smooth
  290. Part21.Color = Color3.new(0.917647, 0.721569, 0.572549)
  291. Part21.Position = Vector3.new(0.291678011, 1.00003505, 1.03549194)
  292. Part21.Color = Color3.new(0.917647, 0.721569, 0.572549)
  293. Script22.Parent = Part21
  294. table.insert(cors,sandbox(Script22,function()
  295. function blow(hit)
  296. local humanoid = hit.Parent:findFirstChild("Humanoid")
  297.  
  298. if humanoid~=nil then
  299. humanoid:TakeDamage(25)
  300. end
  301. end
  302.  
  303.  
  304.  
  305. connection = script.Parent.Touched:connect(blow)
  306.  
  307.  
  308.  
  309. end))
  310. Humanoid23.Name = "Zombie"
  311. Humanoid23.Parent = Model0
  312. Humanoid23.NameOcclusion = Enum.NameOcclusion.NoOcclusion
  313. Humanoid23.RightLeg = Part21
  314. Humanoid23.LeftLeg = Part19
  315. Humanoid23.Torso = Part8
  316. Humanoid23.Health = 135
  317. Humanoid23.MaxHealth = 135
  318. Humanoid23.WalkSpeed = 18
  319. Hat24.Name = "Millitary Beanie"
  320. Hat24.Parent = Model0
  321. Hat24.AttachmentForward = Vector3.new(0, -0.0995037109, -0.995037138)
  322. Hat24.AttachmentPos = Vector3.new(0, 0.349999994, 0)
  323. Hat24.AttachmentUp = Vector3.new(0, 0.995037258, -0.0995037258)
  324. Part25.Name = "Handle"
  325. Part25.Parent = Hat24
  326. Part25.BrickColor = BrickColor.new("Bright red")
  327. Part25.Rotation = Vector3.new(5.71000004, 0, 0)
  328. Part25.CanCollide = false
  329. Part25.FormFactor = Enum.FormFactor.Symmetric
  330. Part25.Size = Vector3.new(1, 1, 1)
  331. Part25.CFrame = CFrame.new(-0.208322003, 4.65177631, 1.0006659, 0.999992847, -1.49081425e-09, -1.48264716e-08, 8.19073628e-12, 0.995037258, -0.0995037258, 1.49012322e-08, 0.0995029956, 0.995030046)
  332. Part25.BottomSurface = Enum.SurfaceType.Smooth
  333. Part25.TopSurface = Enum.SurfaceType.Smooth
  334. Part25.Color = Color3.new(0.768628, 0.156863, 0.109804)
  335. Part25.Position = Vector3.new(-0.208322003, 4.65177631, 1.0006659)
  336. Part25.Orientation = Vector3.new(5.71000004, 0, 0)
  337. Part25.Color = Color3.new(0.768628, 0.156863, 0.109804)
  338. SpecialMesh26.Parent = Part25
  339. SpecialMesh26.MeshId = "http://www.roblox.com/asset/?id=9466401"
  340. SpecialMesh26.Scale = Vector3.new(1, 1.10000002, 0.850000024)
  341. SpecialMesh26.TextureId = "http://www.roblox.com/asset/?id=9466384"
  342. SpecialMesh26.MeshType = Enum.MeshType.FileMesh
  343. SpecialMesh26.Scale = Vector3.new(1, 1.10000002, 0.850000024)
  344. Script27.Name = "Control"
  345. Script27.Parent = Model0
  346. table.insert(cors,sandbox(Script27,function()
  347. wait(.1)
  348. local ammo=15 -- How much ammo the Enemy has
  349. local w=.14
  350. local r=false
  351. local t=script.Parent
  352. Spawn(function()
  353. local c=t:Clone()
  354. wait(1)
  355. t.Humanoid.Died:wait()
  356. wait(3)
  357. c.Parent=workspace
  358. c:MakeJoints()
  359. t:Destroy()
  360. end)
  361. local cf={CFrame.new(.8,.5,.4)*CFrame.Angles(math.rad(270),math.rad(40),0),CFrame.new(-1.2,0.5,0.4)*CFrame.Angles(math.rad(270),math.rad(-5),0)}
  362. local c=LoadLibrary'RbxUtility'.Create
  363. local b1=c'Part'{TopSurface=0;BottomSurface=0;Anchored=true;CanCollide=false;BrickColor=BrickColor.White();Size=Vector3.new(.2,.2,1);c'SpecialMesh'{MeshType=6;Scale=Vector3.new(.2,.2,1)}}
  364. local b2=b1:Clone()
  365. b1.Name,b2.Name='1','2'
  366. local mov=c'Part'{Transparency=1;CanCollide=false;Parent=t;Anchored=true}
  367. local h=t:WaitForChild'Handle'
  368. local function reload(boo)
  369. if(boo and ammo~=30)or ammo==0 then
  370. r=true
  371. if w then
  372. w=.03
  373. end
  374. h.Reload:Play()
  375. wait(6) -- How long the Enemy reloads
  376. ammo=3
  377. if w then
  378. w=.14
  379. end
  380. r=false
  381. elseif boo then
  382. wait(.1)
  383. end
  384. end
  385. local function near()
  386. local dis,pl=5000,nil -- Range of the Enemy
  387. for _,v in ipairs(game.Players:GetPlayers())do
  388. if v.Character and v.Character:FindFirstChild'Humanoid'and v:DistanceFromCharacter(h.Position)<dis then
  389. dis,pl=v:DistanceFromCharacter(h.Position),v
  390. end
  391. end
  392. if pl then
  393. return pl.Character:GetModelCFrame(),dis,CFrame.new(pl.Character.Humanoid.WalkToPoint).lookVector
  394. else
  395. return nil
  396. end
  397. end
  398. Spawn(function()
  399. while true do
  400. t.Humanoid.Jump=false
  401. while not w do wait(.1)end
  402. for i=1,math.random(4,9)do
  403. wait(w)
  404. end
  405. end
  406. end)
  407. Spawn(function()
  408. while wait(math.random(2,7)/10)do
  409. local n=near()
  410. if n and math.random(1,3)==2 or not n then
  411. mov.CFrame=t.Torso.CFrame+t.Torso.CFrame.lookVector*Vector3.new(math.random(-25,25),0,math.random(-25,25))
  412. else
  413. mov.CFrame=n+Vector3.new((math.random(1,2)==1 and 1 or -1)*math.random(25,50),0,(math.random(1,2)==1 and 1 or -1)*math.random(25,50))
  414. end
  415. wait(.1)
  416. t.Zombie:MoveTo(mov.Position,mov)
  417. end
  418. end)
  419. while true do
  420. local n,mag,hum=near()
  421. if n then
  422. n=n.p
  423. if not r then
  424. w=.14
  425. local dir=h.Position-n
  426. local tst,_=workspace:FindPartOnRay(Ray.new(t.Torso.Position,(n-t.Torso.Position).Unit*999),t)
  427. local aim=n+Vector3.new(math.random(-mag*.015,mag*.015),math.random(-mag*.015,mag*.015),math.random(-mag*.015,mag*.015))*(2+math.random())+hum
  428. if tst and tst.Parent and game.Players:GetPlayerFromCharacter(tst.Parent)then
  429. wait(.1)
  430. h.Fire:Play()
  431. local par,pos=workspace:FindPartOnRay(Ray.new(h.Position,(aim-h.Position).Unit*999),t)
  432. if par then
  433. local h=par.Parent:FindFirstChild'Humanoid'or par.Parent.Parent:FindFirstChild'Humanoid'
  434. if h and h.Health-10>0 then
  435. h.Health=h.Health-5 -- How much damage the gun inflicts
  436. elseif h then
  437. h.Health=0
  438. h.Parent:BreakJoints()
  439. end
  440. end
  441. ammo=ammo-1
  442. mag=(h.Position-pos).magnitude
  443. b1.Parent,b2.Parent=t,t
  444. b1.CFrame,b2.CFrame=CFrame.new(h.Position:Lerp(pos,.3),pos),CFrame.new(pos:Lerp(h.Position,.175),h.Position) -- Gun Accuracy (ONLY EDIT IF YOU KNOW WHAT TO DO)
  445. b1.Mesh.Scale,b2.Mesh.Scale=Vector3.new(.2,.2,mag*.75),Vector3.new(.2,.2,mag/4)
  446. Delay(.03,function()b1.Parent=nil wait(.03)b2.Parent=nil end)
  447. end
  448. wait(.045) -- How fast the enemy shoots
  449. if ammo==0 then
  450. reload()
  451. end
  452. end
  453. else
  454. reload(true)
  455. w=false
  456. end
  457. end
  458.  
  459. -- Dellkiller123
  460. end))
  461. Part28.Name = "Handle"
  462. Part28.Parent = Model0
  463. Part28.BrickColor = BrickColor.new("Light orange")
  464. Part28.Transparency = 1
  465. Part28.Rotation = Vector3.new(-180, 85, 180)
  466. Part28.CanCollide = false
  467. Part28.FormFactor = Enum.FormFactor.Symmetric
  468. Part28.Size = Vector3.new(2, 1, 1)
  469. Part28.CFrame = CFrame.new(0.657139182, 3.60003519, -0.545955896, -0.0871557221, -1.04749098e-09, 0.99619472, -1.19293091e-08, 1, 7.81324051e-12, -0.99619472, -1.18832331e-08, -0.0871557221)
  470. Part28.RightSurface = Enum.SurfaceType.Hinge
  471. Part28.Color = Color3.new(0.917647, 0.721569, 0.572549)
  472. Part28.Position = Vector3.new(0.657139182, 3.60003519, -0.545955896)
  473. Part28.Orientation = Vector3.new(0, 95, 0)
  474. Part28.Color = Color3.new(0.917647, 0.721569, 0.572549)
  475. Sound29.Name = "Reload"
  476. Sound29.Parent = Part28
  477. Sound29.SoundId = "http://www.roblox.com/asset/?id=132456279"
  478. Sound29.Volume = 0.10000000149012
  479. Sound30.Name = "Fire"
  480. Sound30.Parent = Part28
  481. Sound30.SoundId = "http://www.roblox.com/asset/?id=139711658"
  482. Sound30.Volume = 1
  483. Script31.Parent = Part28
  484. table.insert(cors,sandbox(Script31,function()
  485. function blow(hit)
  486. local humanoid = hit.Parent:findFirstChild("Humanoid")
  487.  
  488. if humanoid~=nil then
  489. humanoid:TakeDamage(25)
  490. end
  491. end
  492.  
  493.  
  494.  
  495. connection = script.Parent.Touched:connect(blow)
  496.  
  497.  
  498.  
  499. end))
  500. Script32.Name = "MoneyKill"
  501. Script32.Parent = Model0
  502. table.insert(cors,sandbox(Script32,function()
  503. --[[Edited by kirbycaden to make it easier to work with, original was made by some free modeler. Thank you for using a script
  504. that.]]--
  505.  
  506.  
  507. Stat2 = true --Make this either true or false depending if you want something else to go be increased in leaderstats.
  508.  
  509. StatName = "KOs" --Name of stats.
  510.  
  511. IncreaseValue = 1 --Increase in Money/Cash/Points etc.
  512.  
  513. Stat2Name = "Kills" --SecondStat name
  514.  
  515. IncreaseValue2 = 1 --SecondStat increase value.
  516.  
  517. local Humanoid = script.Parent.Zombie --If your zombies have "Zombie" instead of "Humanoid", make this Zombie.
  518. function PwntX_X()
  519. local tag = Humanoid:findFirstChild("creator")
  520. if tag ~= nil then
  521. if tag.Value ~= nil then
  522. local Leaderstats = tag.Value:findFirstChild("leaderstats")
  523. if Leaderstats ~= nil then
  524. Leaderstats[StatName].Value = Leaderstats[StatName].Value + IncreaseValue --Change Money to the stat that is increased.
  525. if Stat2 == true then
  526. Leaderstats[Stat2Name].Value = Leaderstats[Stat2Name].Value + IncreaseValue2
  527. wait(0.1)
  528. script:remove()
  529. end
  530. end
  531. end
  532. end
  533. end
  534. Humanoid.Died:connect(PwntX_X)
  535. end))
  536. Hat33.Name = "Millitary Beanie"
  537. Hat33.Parent = Model0
  538. Hat33.AttachmentForward = Vector3.new(0, -0.0995037109, -0.995037138)
  539. Hat33.AttachmentPos = Vector3.new(0, -0.100000001, 0)
  540. Hat33.AttachmentUp = Vector3.new(0, 0.995037258, -0.0995037258)
  541. Part34.Name = "Handle"
  542. Part34.Parent = Hat33
  543. Part34.BrickColor = BrickColor.new("Bright red")
  544. Part34.Rotation = Vector3.new(5.71000004, 0, 0)
  545. Part34.CanCollide = false
  546. Part34.FormFactor = Enum.FormFactor.Symmetric
  547. Part34.Size = Vector3.new(1, 1, 1)
  548. Part34.CFrame = CFrame.new(-0.208322003, 5.09954262, 1.04544222, 0.999992847, -1.49081425e-09, -1.48264716e-08, 8.19073628e-12, 0.995037258, -0.0995037258, 1.49012322e-08, 0.0995029956, 0.995030046)
  549. Part34.BottomSurface = Enum.SurfaceType.Smooth
  550. Part34.TopSurface = Enum.SurfaceType.Smooth
  551. Part34.Color = Color3.new(0.768628, 0.156863, 0.109804)
  552. Part34.Position = Vector3.new(-0.208322003, 5.09954262, 1.04544222)
  553. Part34.Orientation = Vector3.new(5.71000004, 0, 0)
  554. Part34.Color = Color3.new(0.768628, 0.156863, 0.109804)
  555. SpecialMesh35.Parent = Part34
  556. SpecialMesh35.MeshId = "http://www.roblox.com/asset/?id=76696701"
  557. SpecialMesh35.Scale = Vector3.new(1.26999998, 1.37, 1.26999998)
  558. SpecialMesh35.TextureId = "http://www.roblox.com/asset/?id=121377688"
  559. SpecialMesh35.MeshType = Enum.MeshType.FileMesh
  560. SpecialMesh35.Scale = Vector3.new(1.26999998, 1.37, 1.26999998)
  561. Part36.Parent = Model0
  562. Part36.BrickColor = BrickColor.new("Light orange")
  563. Part36.Rotation = Vector3.new(0, 5, 0)
  564. Part36.CanCollide = false
  565. Part36.FormFactor = Enum.FormFactor.Custom
  566. Part36.Size = Vector3.new(1, 0.200000003, 2)
  567. Part36.CFrame = CFrame.new(0.657119393, 4.20004225, -0.545908213, 0.996187568, -1.04743259e-09, 0.087155126, 7.85868159e-12, 1, 1.19289476e-08, -0.087155126, -1.18828343e-08, 0.996187568)
  568. Part36.TopSurface = Enum.SurfaceType.Smooth
  569. Part36.Color = Color3.new(0.917647, 0.721569, 0.572549)
  570. Part36.Position = Vector3.new(0.657119393, 4.20004225, -0.545908213)
  571. Part36.Orientation = Vector3.new(0, 5, 0)
  572. Part36.Color = Color3.new(0.917647, 0.721569, 0.572549)
  573. SpecialMesh37.Parent = Part36
  574. SpecialMesh37.MeshId = "http://www.roblox.com/asset/?id=3824749"
  575. SpecialMesh37.Offset = Vector3.new(-0.174999997, -0.600000024, -0.174999997)
  576. SpecialMesh37.Scale = Vector3.new(1.70000005, 1.29999995, 1.10000002)
  577. SpecialMesh37.TextureId = "http://www.roblox.com/asset/?id=159740858"
  578. SpecialMesh37.VertexColor = Vector3.new(0.699999988, 0.699999988, 0.699999988)
  579. SpecialMesh37.MeshType = Enum.MeshType.FileMesh
  580. SpecialMesh37.Scale = Vector3.new(1.70000005, 1.29999995, 1.10000002)
  581. Script38.Name = "RaceGenerator"
  582. Script38.Parent = Model0
  583. table.insert(cors,sandbox(Script38,function()
  584. colors={"Brick yellow", "Light orange", "Nougat", "Bright orange"}
  585. Color=BrickColor.new(colors[math.random(1,6)])
  586. for i,v in pairs(script.Parent:GetChildren()) do
  587. if v.Name=='Head' or v.Name=='Right Leg' or v.Name=='Right Arm' or v.Name=='Left Arm' or v.Name=='Left Leg' or v.Name=='Torso' then
  588. v.BrickColor=Color
  589. end
  590. end
  591. end))
  592. Pants39.Name = "Pants"
  593. Pants39.Parent = Model0
  594. Pants39.PantsTemplate = "http://www.roblox.com/asset/?id=221961768"
  595. Shirt40.Name = "Shirt"
  596. Shirt40.Parent = Model0
  597. Shirt40.ShirtTemplate = "http://www.roblox.com/asset/?id=221961698"
  598. Script41.Name = "spawnHandler"
  599. Script41.Parent = Model0
  600. table.insert(cors,sandbox(Script41,function()
  601. local NPC = script.Parent
  602. local cln=NPC:Clone()
  603. local Config = NPC.Configuration
  604. local Head, Torso, LArm, RArm, LLeg, RLeg = NPC.Head, NPC.Torso, NPC['Left Arm'], NPC['Right Arm'], NPC['Left Leg'], NPC['Right Leg'];
  605. local Humanoid;
  606. print('Starting bot setup')
  607. -- Preset config
  608. Config.HumanoidReady.Value = false;
  609.  
  610. -- Make sure parts are anchored
  611. function anchor(bool)
  612. for _,child in pairs(script.Parent:GetChildren()) do
  613. if child:IsA('Part') and child.Name~='MoveHere' then
  614. child.Anchored=bool
  615. end
  616. end
  617. end
  618.  
  619.  
  620. anchor(true)
  621.  
  622. function Join(MainPart, LegacyPart, Parent, C0, C1)
  623. local Joint = Instance.new("Motor");
  624. Joint.Part0 = MainPart
  625. Joint.Part1 = LegacyPart
  626. Joint.C0 = C0
  627. Joint.C1 = C1
  628. Joint.Parent = Parent -- !Important: Without parenting last, the C1 and C0 will take affect and prematurely move the parts.
  629. return Joint;
  630. end
  631.  
  632. for _,child in pairs(script.Parent:children()) do
  633. if child:IsA('Part') then
  634. Join(Torso,child,Torso,CFrame.new(),child.CFrame:toObjectSpace(Torso.CFrame))
  635. end
  636. end
  637. -- -- Build NPC
  638. -- --Join(script.Parent['Right Arm'],script.Parent.Handle, script.Parent['Right Arm'] ,CFrame.new(),script.Parent.Handle.CFrame:toObjectSpace(script.Parent['Right Arm'].CFrame));
  639. -- print('Welded Gun')
  640. -- Join(Torso,script.Parent.Hat1, Torso,CFrame.new(),script.Parent.Hat1.CFrame:toObjectSpace(Torso.CFrame));
  641. -- Join(Torso,script.Parent.Hat2, Torso,CFrame.new(),script.Parent.Hat2.CFrame:toObjectSpace(Torso.CFrame));
  642. -- Join(Torso, Head, Torso, CFrame.new(), Head.CFrame:toObjectSpace(Torso.CFrame));
  643. -- Join(Torso, script.Parent['Left Arm'], Torso, CFrame.new(), script.Parent['Left Arm'].CFrame:toObjectSpace(Torso.CFrame));
  644. -- Join(Torso, script.Parent['Right Arm'], Torso, CFrame.new(), script.Parent['Right Arm'].CFrame:toObjectSpace(Torso.CFrame));
  645. -- Join(Torso, LLeg, Torso, CFrame.new(0.5,-1,0), CFrame.new(0,1,0));
  646. -- Join(Torso, RLeg, Torso, CFrame.new(-0.5,-1,0), CFrame.new(0,1,0));
  647. Humanoid = Instance.new("Humanoid");
  648. Humanoid.Name = "Zombie";
  649. Humanoid.Parent = NPC;
  650. Config.HumanoidReady.Value = true;
  651. wait()
  652. anchor(false)
  653.  
  654. Humanoid.Died:connect(function()
  655. wait(3)
  656. local np=cln
  657. cln.Parent=workspace
  658. NPC:Remove()
  659. end)
  660. end))
  661. Script42.Name = "Respawn"
  662. Script42.Parent = Model0
  663. table.insert(cors,sandbox(Script42,function()
  664. name="Zombie"
  665.  
  666. robo=script.Parent:clone()
  667.  
  668. while true do
  669. wait(20)
  670. if script.Parent.Zombie.Health<1 then
  671. robot=robo:clone()
  672. robot.Parent=script.Parent.Parent
  673. robot:makeJoints()
  674. script.Parent:remove()
  675. end
  676. end
  677.  
  678.  
  679.  
  680.  
  681. end))
  682. Script43.Name = "Robot"
  683. Script43.Parent = Model0
  684. table.insert(cors,sandbox(Script43,function()
  685. miked=script.Parent
  686.  
  687. itlh=miked.Torso:findFirstChild("Left Hip")
  688. itlh.Part0=miked.Torso
  689. itlh.Part1=miked:findFirstChild("Left Leg")
  690. itlh.C0=CFrame.new(-1, -1, 0, 0, 0, -1, 0, 1, 0, 1, 0, 0)
  691.  
  692. itrh=miked.Torso:findFirstChild("Right Hip")
  693. itrh.Part0=miked.Torso
  694. itrh.Part1=miked:findFirstChild("Right Leg")
  695. itrh.C0=CFrame.new(1, -1, 0, 0, 0, 1, 0, 1, 0, -1, 0, 0)
  696.  
  697. itls=miked.Torso:findFirstChild("Left Shoulder")
  698. itls.Part1=miked.Torso
  699. itls.C0=CFrame.new(2, 0.5, 0, 0, 0, -1, 0, 1, 0, 1, 0, 0)
  700. itls.Part0=miked:findFirstChild("Left Arm")
  701.  
  702. itrs=miked.Torso:findFirstChild("Right Shoulder")
  703. itrs.Part1=miked.Torso
  704. itrs.C0=CFrame.new(-2, 0.5, 0, 0, 0, 1, 0, 1, 0, -1, 0, 0)
  705. itrs.Part0=miked:findFirstChild("Right Arm")
  706.  
  707. miked.Head:makeJoints()
  708. ------------------
  709. ------------------
  710.  
  711.  
  712. function waitForChild(parent, childName)
  713. while true do
  714. local child = parent:findFirstChild(childName)
  715. if child then
  716. return child
  717. end
  718. parent.ChildAdded:wait()
  719. end
  720. end
  721.  
  722. local Figure = script.Parent
  723. local Torso = waitForChild(Figure, "Torso")
  724. local RightShoulder = waitForChild(Torso, "Right Shoulder")
  725. local LeftShoulder = waitForChild(Torso, "Left Shoulder")
  726. local RightHip = waitForChild(Torso, "Right Hip")
  727. local LeftHip = waitForChild(Torso, "Left Hip")
  728. local Neck = waitForChild(Torso, "Neck")
  729. local Humanoid = waitForChild(Figure, "Humanoid")
  730. local pose = "Standing"
  731.  
  732. local toolAnim = "None"
  733. local toolAnimTime = 0
  734.  
  735. local isSeated = false
  736.  
  737.  
  738. function onRunning(speed)
  739. if isSeated then return end
  740.  
  741. if speed>0 then
  742. pose = "Running"
  743. else
  744. pose = "Standing"
  745. end
  746. end
  747.  
  748. function onDied()
  749. pose = "Dead"
  750. end
  751.  
  752. function onJumping()
  753. isSeated = false
  754. pose = "Jumping"
  755. end
  756.  
  757. function onClimbing()
  758. pose = "Climbing"
  759. end
  760.  
  761. function onGettingUp()
  762. pose = "GettingUp"
  763. end
  764.  
  765. function onFreeFall()
  766. pose = "FreeFall"
  767. end
  768.  
  769. function onDancing()
  770. pose = "Dancing"
  771. end
  772.  
  773. function onFallingDown()
  774. pose = "FallingDown"
  775. end
  776.  
  777. function onSeated()
  778. isSeated = true
  779. pose = "Seated"
  780. end
  781.  
  782.  
  783.  
  784. function moveJump()
  785. RightShoulder.MaxVelocity = 0.5
  786. LeftShoulder.MaxVelocity = 0.5
  787. RightShoulder.DesiredAngle = -3.14
  788. LeftShoulder.DesiredAngle = -3.14
  789. RightHip.DesiredAngle = 0
  790. LeftHip.DesiredAngle = 0
  791. end
  792.  
  793. function moveFreeFall()
  794. RightShoulder.MaxVelocity = 0.5
  795. LeftShoulder.MaxVelocity = 0.5
  796. RightShoulder.DesiredAngle = -1
  797. LeftShoulder.DesiredAngle = -1
  798. RightHip.DesiredAngle = 0
  799. LeftHip.DesiredAngle = 0
  800. end
  801.  
  802. function moveFloat()
  803. RightShoulder.MaxVelocity = 0.5
  804. LeftShoulder.MaxVelocity = 0.5
  805. RightShoulder.DesiredAngle = -1.57
  806. LeftShoulder.DesiredAngle = 1.57
  807. RightHip.DesiredAngle = 1.57
  808. LeftHip.DesiredAngle = -1.57
  809. end
  810.  
  811. function moveBoogy()
  812. while pose=="Boogy" do
  813. wait(.5)
  814. RightShoulder.MaxVelocity = 1
  815. LeftShoulder.MaxVelocity = 1
  816. RightShoulder.DesiredAngle = -3.14
  817. LeftShoulder.DesiredAngle = 0
  818. RightHip.DesiredAngle = 1.57
  819. LeftHip.DesiredAngle = 0
  820. wait(.5)
  821. RightShoulder.MaxVelocity = 1
  822. LeftShoulder.MaxVelocity = 1
  823. RightShoulder.DesiredAngle = 0
  824. LeftShoulder.DesiredAngle = -3.14
  825. RightHip.DesiredAngle = 0
  826. LeftHip.DesiredAngle = 1.57
  827. end
  828. end
  829.  
  830. function moveZombie()
  831. RightShoulder.MaxVelocity = 0.5
  832. LeftShoulder.MaxVelocity = 0.5
  833. RightShoulder.DesiredAngle = -1.57
  834. LeftShoulder.DesiredAngle = 1.57
  835. RightHip.DesiredAngle = 0
  836. LeftHip.DesiredAngle = 0
  837. end
  838.  
  839. function movePunch()
  840. script.Parent.Torso.Anchored=true
  841. RightShoulder.MaxVelocity = 60
  842. LeftShoulder.MaxVelocity = 0.5
  843. RightShoulder.DesiredAngle = -1.57
  844. LeftShoulder.DesiredAngle = 0
  845. RightHip.DesiredAngle = 0
  846. LeftHip.DesiredAngle = 0
  847. wait(1)
  848. script.Parent.Torso.Anchored=false
  849. pose="Standing"
  850.  
  851. end
  852.  
  853. function moveKick()
  854. RightShoulder.MaxVelocity = 0.5
  855. LeftShoulder.MaxVelocity = 0.5
  856. RightShoulder.DesiredAngle = 0
  857. LeftShoulder.DesiredAngle = 0
  858. RightHip.MaxVelocity = 40
  859. RightHip.DesiredAngle = 1.57
  860. LeftHip.DesiredAngle = 0
  861. wait(1)
  862. pose="Standing"
  863.  
  864. end
  865.  
  866. function moveFly()
  867. RightShoulder.MaxVelocity = 0.5
  868. LeftShoulder.MaxVelocity = 0.5
  869. RightShoulder.DesiredAngle = 0
  870. LeftShoulder.DesiredAngle = 0
  871. RightHip.MaxVelocity = 40
  872. RightHip.DesiredAngle = 1.57
  873. LeftHip.DesiredAngle = 0
  874. wait(1)
  875. pose="Standing"
  876.  
  877. end
  878.  
  879.  
  880. function moveClimb()
  881. RightShoulder.MaxVelocity = 0.5
  882. LeftShoulder.MaxVelocity = 0.5
  883. RightShoulder.DesiredAngle = -3.14
  884. LeftShoulder.DesiredAngle = 3.14
  885. RightHip.DesiredAngle = 0
  886. LeftHip.DesiredAngle = 0
  887. end
  888.  
  889. function moveSit()
  890. RightShoulder.MaxVelocity = 0.15
  891. LeftShoulder.MaxVelocity = 0.15
  892. RightShoulder.DesiredAngle = -3.14 /2
  893. LeftShoulder.DesiredAngle = -3.14 /2
  894. RightHip.DesiredAngle = 3.14 /2
  895. LeftHip.DesiredAngle = -3.14 /2
  896. end
  897.  
  898. function getTool()
  899.  
  900. kidTable = Figure:children()
  901. if (kidTable ~= nil) then
  902. numKids = #kidTable
  903. for i=1,numKids do
  904. if (kidTable[i].className == "Tool") then return kidTable[i] end
  905. end
  906. end
  907.  
  908. return nil
  909. end
  910.  
  911. function getToolAnim(tool)
  912.  
  913. c = tool:children()
  914. for i=1,#c do
  915. if (c[i].Name == "toolanim" and c[i].className == "StringValue") then
  916. return c[i]
  917. end
  918. end
  919. return nil
  920. end
  921.  
  922. function animateTool()
  923.  
  924. if (toolAnim == "None") then
  925. RightShoulder.DesiredAngle = -1.57
  926. return
  927. end
  928.  
  929. if (toolAnim == "Slash") then
  930. RightShoulder.MaxVelocity = 0.5
  931. RightShoulder.DesiredAngle = 0
  932. return
  933. end
  934.  
  935. if (toolAnim == "Lunge") then
  936. RightShoulder.MaxVelocity = 0.5
  937. LeftShoulder.MaxVelocity = 0.5
  938. RightHip.MaxVelocity = 0.5
  939. LeftHip.MaxVelocity = 0.5
  940. RightShoulder.DesiredAngle = -1.57
  941. LeftShoulder.DesiredAngle = 1.0
  942. RightHip.DesiredAngle = 1.57
  943. LeftHip.DesiredAngle = 1.0
  944. return
  945. end
  946. end
  947.  
  948. function move(time)
  949. local amplitude
  950. local frequency
  951.  
  952. if (pose == "Jumping") then
  953. moveJump()
  954. return
  955. end
  956.  
  957. if (pose == "Zombie") then
  958. moveZombie()
  959. return
  960. end
  961.  
  962. if (pose == "Boogy") then
  963. moveBoogy()
  964. return
  965. end
  966.  
  967. if (pose == "Float") then
  968. moveFloat()
  969. return
  970. end
  971.  
  972. if (pose == "Punch") then
  973. movePunch()
  974. return
  975. end
  976.  
  977. if (pose == "Kick") then
  978. moveKick()
  979. return
  980. end
  981.  
  982. if (pose == "Fly") then
  983. moveFly()
  984. return
  985. end
  986.  
  987. if (pose == "FreeFall") then
  988. moveFreeFall()
  989. return
  990. end
  991.  
  992. if (pose == "Climbing") then
  993. moveClimb()
  994. return
  995. end
  996.  
  997. if (pose == "Seated") then
  998. moveSit()
  999. return
  1000. end
  1001.  
  1002. amplitude = 0.1
  1003. frequency = 1
  1004.  
  1005. RightShoulder.MaxVelocity = 0.15
  1006. LeftShoulder.MaxVelocity = 0.15
  1007. if (pose == "Running") then
  1008. amplitude = 1
  1009. frequency = 9
  1010. elseif (pose == "Dancing") then
  1011. amplitude = 2
  1012. frequency = 16
  1013. end
  1014.  
  1015.  
  1016. desiredAngle = amplitude * math.sin(time*frequency)
  1017. if pose~="Dancing" then
  1018. RightShoulder.DesiredAngle = -desiredAngle
  1019. LeftShoulder.DesiredAngle = desiredAngle
  1020. RightHip.DesiredAngle = -desiredAngle
  1021. LeftHip.DesiredAngle = -desiredAngle
  1022. else
  1023. RightShoulder.DesiredAngle = desiredAngle
  1024. LeftShoulder.DesiredAngle = desiredAngle
  1025. RightHip.DesiredAngle = -desiredAngle
  1026. LeftHip.DesiredAngle = -desiredAngle
  1027. end
  1028.  
  1029.  
  1030.  
  1031. local tool = getTool()
  1032.  
  1033. if tool ~= nil then
  1034.  
  1035. animStringValueObject = getToolAnim(tool)
  1036.  
  1037. if animStringValueObject ~= nil then
  1038. toolAnim = animStringValueObject.Value
  1039. -- message recieved, delete StringValue
  1040. animStringValueObject.Parent = nil
  1041. toolAnimTime = time + .3
  1042. end
  1043.  
  1044. if time > toolAnimTime then
  1045. toolAnimTime = 0
  1046. toolAnim = "None"
  1047. end
  1048.  
  1049. animateTool()
  1050.  
  1051.  
  1052. else
  1053. toolAnim = "None"
  1054. toolAnimTime = 0
  1055. end
  1056. end
  1057.  
  1058.  
  1059. -- connect events
  1060. -----------------------------------------------------------------------------------------------------------------------
  1061.  
  1062. function unequip()
  1063. local items=script.Parent:children()
  1064. for i=1, #items do
  1065. if items[i].className=="Tool" then items[i]:remove() end
  1066. end
  1067. end
  1068.  
  1069. function onChatted(msg, recipient)
  1070. msg = string.lower(msg)
  1071.  
  1072. if string.match(msg, string.lower(script.Parent.Name))~=nil or string.match(msg, "everyone") then
  1073. if string.match(msg, "equip") then
  1074. if game.Workspace:findFirstChild("Hub") then
  1075. if string.match(msg, "rocket") then unequip()
  1076. game.Workspace.Hub.Rocket:clone().Parent=script.Parent
  1077. elseif string.match(msg, "slingshot") then unequip()
  1078. game.Workspace.Hub.Slingshot:clone().Parent=script.Parent
  1079. elseif string.match(msg, "sword") then unequip()
  1080. game.Workspace.Hub.Sword:clone().Parent=script.Parent
  1081. elseif string.match(msg, "pbg") then unequip()
  1082. game.Workspace.Hub.PBG:clone().Parent=script.Parent
  1083. elseif string.match(msg, "superball") then unequip()
  1084. game.Workspace.Hub.Superball:clone().Parent=script.Parent
  1085. elseif string.match(msg, "trowel") then unequip()
  1086. game.Workspace.Hub.Trowel:clone().Parent=script.Parent
  1087. elseif string.match(msg, "bomb") then unequip()
  1088. game.Workspace.Hub.Bomb:clone().Parent=script.Parent
  1089. end
  1090. end
  1091. end
  1092. if string.match(msg, "unequip") then unequip() end
  1093. if string.match(msg, "run") then onRunning(1) end
  1094. if string.match(msg, "climb") then onClimbing() end
  1095. if string.match(msg, "jump") then onJumping() end
  1096. if string.match(msg, "zombie") then pose="Zombie" end
  1097. if string.match(msg, "disco") then pose="Boogy" end
  1098. if string.match(msg, "float") then pose="Float" end
  1099. if string.match(msg, "punch") then pose="Punch" end
  1100. if string.match(msg, "kick") then pose="Kick" end
  1101. if string.match(msg, "fly") then pose="Fly" end
  1102. if string.match(msg, "heal") then script.Parent.Humanoid.Health=script.Parent.Humanoid.MaxHealth end
  1103. if string.match(msg, "defend") then defence() end
  1104. if string.match(msg, "stop") then pose="Standing"; proxkill=false; following=false; stopmoving() end
  1105. if string.match(msg, "go home") then following=false; gohome() end
  1106. if string.match(msg, "follow") then
  1107. if string.match(msg, "all") then
  1108. followany()
  1109. else
  1110. local egg=game.Players:children()
  1111. for i=1, #egg do
  1112. if string.match(msg, string.lower(egg[i].Name)) then
  1113. follow(egg[i].Name)
  1114. return
  1115. end
  1116. end
  1117. end
  1118. end
  1119. if string.match(msg, "kill") then
  1120. if string.match(msg, "all") then
  1121. attackany()
  1122. else
  1123. local egg=game.Players:children()
  1124. for i=1, #egg do
  1125. if string.match(msg, string.lower(egg[i].Name)) then
  1126. attack(egg[i].Name)
  1127. return
  1128. end
  1129. end
  1130. end
  1131. end
  1132.  
  1133. end
  1134. end
  1135.  
  1136. if game.Players.NumPlayers>1 then
  1137. x=game.Players:children()
  1138.  
  1139. for i=1, #x do
  1140. if script.Parent:findFirstChild("Commander")~=nil then
  1141. if script.Parent.Commander:children()~=nil or script.Parent.Commander:children()>0 then
  1142. local ch=script.Parent.Commander:children()
  1143. for i=1, #ch do
  1144. if string.lower(ch[i].Name)==string.lower(x[i].Name) then
  1145. x[i].Chatted:connect(function(msg, recipient) onChatted(msg, recipient) end)
  1146. end
  1147. end
  1148. elseif string.lower(script.Parent.Commander.Value)==string.lower(x[i].Name) then
  1149. x[i].Chatted:connect(function(msg, recipient) onChatted(msg, recipient) end)
  1150. end
  1151. else
  1152. x[i].Chatted:connect(function(msg, recipient) onChatted(msg, recipient) end)
  1153. end
  1154. end
  1155. end
  1156.  
  1157.  
  1158. function onPlayerEntered(Player)
  1159. while Player.Name==nil do
  1160. wait(2)
  1161. end
  1162. if script.Parent:findFirstChild("Commander")~=nil then
  1163. if script.Parent.Commander:children()~=nil or script.Parent.Commander:children()>0 then
  1164. local ch=script.Parent.Commander:children()
  1165. for i=1, #ch do
  1166. if string.lower(ch[i].Name)==string.lower(Player.Name) then
  1167. Player.Chatted:connect(function(msg, recipient) onChatted(msg, recipient) end)
  1168. end
  1169. end
  1170. elseif string.lower(script.Parent.Commander.Value)==string.lower(Player.Name) then
  1171. Player.Chatted:connect(function(msg, recipient) onChatted(msg, recipient) end)
  1172. end
  1173. else
  1174. Player.Chatted:connect(function(msg, recipient) onChatted(msg, recipient) end)
  1175. end
  1176. end
  1177.  
  1178. game.Players.ChildAdded:connect(onPlayerEntered)
  1179.  
  1180.  
  1181.  
  1182. -----------------------------------------------------------------------------------------------------------------------
  1183. -----------------------------------------------------------------------------------------------------------------------
  1184. -----------------------------------------------------------------------------------------------------------------------
  1185. -----------------------------------------------------------------------------------------------------------------------
  1186. -----------------------------------------------------------------------------------------------------------------------
  1187. -----------------------------------------------------------------------------------------------------------------------
  1188. -----------------------------------------------------------------------------------------------------------------------
  1189. -----------------------------------------------------------------------------------------------------------------------
  1190. -----------------------------------------------------------------------------------------------------------------------
  1191. -----------------------------------------------------------------------------------------------------------------------
  1192. -----------------------------------------------------------------------------------------------------------------------
  1193. -----------------------------------------------------------------------------------------------------------------------
  1194. dist=20
  1195.  
  1196. function followany()
  1197. following=true
  1198. while following==true do
  1199.  
  1200. local ch=game.Players:children()
  1201. for i=1, #ch do
  1202. local l=game.Workspace:findFirstChild(ch[i].Name)
  1203. if l~=nil then
  1204. local s=l.Torso
  1205. local p=l.Torso.Position
  1206. local q=script.Parent.Torso.Position
  1207. local d=math.sqrt( ((p.x-q.x)^2)+((p.y-q.y)^2)+((p.z-q.z)^2) )
  1208. if smallest==nil then
  1209. smallest=d
  1210. target=s
  1211. elseif d<smallest then
  1212. smallest=d
  1213. target=s
  1214. end
  1215. end
  1216. end
  1217.  
  1218. if smallest==nil then stopmoving() return end
  1219.  
  1220. if smallest>6*dist then return end
  1221.  
  1222. script.Parent.Humanoid:MoveTo(target.Position, target)
  1223.  
  1224. wait(0.5)
  1225. for i=1, 6 do
  1226. if target.Parent.Humanoid.Health<1 then stopmoving() else wait(0.5) end
  1227. end
  1228. end
  1229. end
  1230.  
  1231.  
  1232.  
  1233. function gohome()
  1234. script.Parent.Humanoid:MoveTo(Vector3.new(0,0,0), game.Workspace.Bases.Base)
  1235. end
  1236. function stopmoving()
  1237. script.Parent.Humanoid:MoveTo(script.Parent.Torso.Position, script.Parent.Torso)
  1238. end
  1239.  
  1240. function follow(name)
  1241. following=true
  1242.  
  1243. local p=game.Workspace:findFirstChild(name)
  1244. if p==nil then return end
  1245. while following==true do
  1246. script.Parent.Humanoid:MoveTo(p.Torso.Position, p.Torso)
  1247. wait(0.5)
  1248. for i=1, 3 do
  1249. if p.Humanoid.Health<1 then following=false; stopmoving() return end
  1250. wait(0.5)
  1251. end
  1252. end
  1253. end
  1254.  
  1255. function attack(name)
  1256. if script.Parent:findFirstChild("Sword")~=nil then
  1257. following=true
  1258. local p=game.Workspace:findFirstChild(name)
  1259. if p==nil then return end
  1260. while following==true do
  1261. script.Parent.Humanoid:MoveTo(p.Torso.Position, p.Torso)
  1262. wait(0.5)
  1263. for i=1, 3 do
  1264. if p.Humanoid.Health<1 then following=false; stopmoving() return end
  1265. local l=p.Torso.Position
  1266. local q=script.Parent.Torso.Position
  1267. local d=math.sqrt( ((l.x-q.x)^2)+((l.y-q.y)^2)+((l.z-q.z)^2) )
  1268. if d<10 then
  1269. script.Parent.Humanoid:MoveTo(p.Torso.Position, p.Torso); slash()
  1270. if (q.y-l.y)>3 and (q.y-l.y)<7 then
  1271. script.Parent.Humanoid:MoveTo(p.Torso.Position+Vector3.new(math.random(-4,4),0,math.random(-4,4)), p.Torso);
  1272. end
  1273. end
  1274. wait(1)
  1275. end
  1276. end
  1277. end
  1278. end
  1279.  
  1280. function attackany()
  1281. if script.Parent:findFirstChild("Sword")~=nil then
  1282.  
  1283. following=true
  1284. while following==true do
  1285.  
  1286. local ch=game.Players:children()
  1287. for i=1, #ch do
  1288. local l=game.Workspace:findFirstChild(ch[i].Name)
  1289. if l~=nil then
  1290. local s=l.Torso
  1291. local p=l.Torso.Position
  1292. local q=script.Parent.Torso.Position
  1293. local d=math.sqrt( ((p.x-q.x)^2)+((p.y-q.y)^2)+((p.z-q.z)^2) )
  1294. if smallest==nil then
  1295. smallest=d
  1296. target=s
  1297. elseif d<smallest then
  1298. smallest=d
  1299. target=s
  1300. end
  1301. end
  1302. end
  1303.  
  1304. if smallest==nil then stopmoving() return end
  1305.  
  1306. if smallest>6*dist then return end
  1307.  
  1308. script.Parent.Humanoid:MoveTo(target.Position, target)
  1309.  
  1310. if smallest<10 then
  1311. slash()
  1312. end
  1313. if target.Parent==nil then stopmoving() return end
  1314. wait(0.5)
  1315. for i=1, 3 do
  1316. if target.Parent.Humanoid.Health<1 then
  1317. stopmoving()
  1318. else
  1319. local p=target.Position
  1320. local q=script.Parent.Torso.Position
  1321. local d=math.sqrt( ((p.x-q.x)^2)+((p.y-q.y)^2)+((p.z-q.z)^2) )
  1322. if d<10 then
  1323. script.Parent.Humanoid:MoveTo(target.Position, target); slash()
  1324. if (q.y-p.y)>3 and (q.y-p.y)<7 then
  1325. script.Parent.Humanoid:MoveTo(p.Torso.Position+Vector3.new(math.random(-4,4),0,math.random(-4,4)), p.Torso);
  1326. end
  1327. end
  1328. wait(1)
  1329. end
  1330. end
  1331. end
  1332. end
  1333. end
  1334.  
  1335.  
  1336. function patrol()
  1337. if points==nil then
  1338. points=0
  1339. if game.Workspace:findFirstChild("pp1")~=nil then
  1340. pp1=game.Workspace:findFirstChild("pp1")
  1341. local points=points+1
  1342. if game.Workspace:findFirstChild("pp2")~=nil then
  1343. pp2=game.Workspace:findFirstChild("pp2")
  1344. local points=points+1
  1345. if game.Workspace:findFirstChild("pp3")~=nil then
  1346. pp3=game.Workspace:findFirstChild("pp3")
  1347. local points=points+1
  1348. if game.Workspace:findFirstChild("pp4")~=nil then
  1349. pp4=game.Workspace:findFirstChild("pp4")
  1350. local points=points+1
  1351. if game.Workspace:findFirstChild("pp5")~=nil then
  1352. pp5=game.Workspace:findFirstChild("pp5")
  1353. local points=points+1
  1354. if game.Workspace:findFirstChild("pp6")~=nil then
  1355. pp6=game.Workspace:findFirstChild("pp6")
  1356. local points=points+1
  1357. if game.Workspace:findFirstChild("pp7")~=nil then
  1358. pp7=game.Workspace:findFirstChild("pp7")
  1359. local points=points+1
  1360. if game.Workspace:findFirstChild("pp8")~=nil then
  1361. pp8=game.Workspace:findFirstChild("pp8")
  1362. local points=points+1
  1363. if game.Workspace:findFirstChild("pp9")~=nil then
  1364. pp9=game.Workspace:findFirstChild("pp9")
  1365. local points=points+1
  1366. end
  1367. end
  1368. end
  1369. end
  1370. end
  1371. end
  1372. end
  1373. end
  1374. end
  1375. end
  1376.  
  1377. if points<1 then return end
  1378. patrolling=true
  1379. local time=2
  1380. if points==1 then return end
  1381. if points>1 then
  1382. while patrolling==true do
  1383. script.Parent.Humanoid:MoveTo(pp1.Position, pp1)
  1384. wait(time)
  1385. script.Parent.Humanoid:MoveTo(pp2.Position, pp2)
  1386. wait(time)
  1387. if points>2 then
  1388. script.Parent.Humanoid:MoveTo(pp3.Position, pp3)
  1389. wait(time)
  1390. if points>3 then
  1391. script.Parent.Humanoid:MoveTo(pp4.Position, pp4)
  1392. wait(time)
  1393. if points>4 then
  1394. script.Parent.Humanoid:MoveTo(pp5.Position, pp5)
  1395. wait(time)
  1396. if points>5 then
  1397. script.Parent.Humanoid:MoveTo(pp6.Position, pp6)
  1398. wait(time)
  1399. if points>6 then
  1400. script.Parent.Humanoid:MoveTo(pp7.Position, pp7)
  1401. wait(time)
  1402. if points>7 then
  1403. script.Parent.Humanoid:MoveTo(pp8.Position, pp8)
  1404. wait(time)
  1405. if points>8 then
  1406. script.Parent.Humanoid:MoveTo(pp9.Position, pp9)
  1407. wait(time)
  1408. end
  1409. end
  1410. end
  1411. end
  1412. end
  1413. end
  1414. end
  1415. end
  1416. end
  1417. end
  1418.  
  1419.  
  1420. function goto(pos,part)
  1421. while true do
  1422. end
  1423. end
  1424.  
  1425.  
  1426. function slash()
  1427. for i=1, 3 do
  1428. wait(.3)
  1429. RightShoulder.MaxVelocity = 2
  1430. LeftShoulder.MaxVelocity = 1
  1431. RightShoulder.DesiredAngle = -2.14
  1432. LeftShoulder.DesiredAngle = 0
  1433. RightHip.DesiredAngle = 0
  1434. LeftHip.DesiredAngle = 0
  1435. wait(.2)
  1436. RightShoulder.MaxVelocity = 2
  1437. LeftShoulder.MaxVelocity = 1
  1438. RightShoulder.DesiredAngle = 0
  1439. LeftShoulder.DesiredAngle = 0
  1440. RightHip.DesiredAngle = 0
  1441. LeftHip.DesiredAngle = 0
  1442. end
  1443. end
  1444.  
  1445. function defence()
  1446. proxkill=true
  1447. while proxkill==true do
  1448. local ch=game.Players:children()
  1449. for i=1, #ch do
  1450. local p=game.Workspace:findFirstChild(ch[i].Name)
  1451. if p~=nil then
  1452. local p=p.Torso.Position
  1453. local q=script.Parent.Torso.Position
  1454. local d=math.sqrt( ((p.x-q.x)^2)+((p.y-q.y)^2)+((p.z-q.z)^2) )
  1455. if d<dist and d>8 then
  1456. local ex=Instance.new("Explosion")
  1457. ex.Position=p
  1458. ex.Parent=game.Workspace
  1459. end
  1460. end
  1461. end
  1462. wait(1)
  1463. end
  1464. end
  1465.  
  1466.  
  1467.  
  1468.  
  1469. -----------------------------------------------------------------------------------------------------------------------
  1470. -----------------------------------------------------------------------------------------------------------------------
  1471. -----------------------------------------------------------------------------------------------------------------------
  1472. -----------------------------------------------------------------------------------------------------------------------
  1473. -----------------------------------------------------------------------------------------------------------------------
  1474. -----------------------------------------------------------------------------------------------------------------------
  1475. -----------------------------------------------------------------------------------------------------------------------
  1476. -----------------------------------------------------------------------------------------------------------------------
  1477. -----------------------------------------------------------------------------------------------------------------------
  1478. -----------------------------------------------------------------------------------------------------------------------
  1479. -----------------------------------------------------------------------------------------------------------------------
  1480. -----------------------------------------------------------------------------------------------------------------------
  1481.  
  1482.  
  1483. Humanoid.Died:connect(onDied)
  1484. Humanoid.Running:connect(onRunning)
  1485. Humanoid.Jumping:connect(onJumping)
  1486. Humanoid.Climbing:connect(onClimbing)
  1487. Humanoid.GettingUp:connect(onGettingUp)
  1488. Humanoid.FreeFalling:connect(onFreeFall)
  1489. Humanoid.FallingDown:connect(onFallingDown)
  1490. Humanoid.Seated:connect(onSeated)
  1491.  
  1492.  
  1493. --[[
  1494.  
  1495. function newSound(id)
  1496. local sound = Instance.new("Sound")
  1497. sound.SoundId = id
  1498. sound.Parent = script.Parent.Head
  1499. return sound
  1500. end
  1501.  
  1502.  
  1503. local sDied = newSound("rbxasset://sounds/uuhhh.wav")
  1504. local sFallingDown = newSound("rbxasset://sounds/splat.wav")
  1505. local sFreeFalling = newSound("rbxasset://sounds/swoosh.wav")
  1506. local sGettingUp = newSound("rbxasset://sounds/hit.wav")
  1507. local sJumping = newSound("rbxasset://sounds/button.wav")
  1508. local sRunning = newSound("rbxasset://sounds/bfsl-minifigfoots1.mp3")
  1509. sRunning.Looped = true
  1510.  
  1511. local Figure = script.Parent
  1512. local Head = waitForChild(Figure, "Head")
  1513. local Humanoid = waitForChild(Figure, "Humanoid")
  1514.  
  1515.  
  1516. function onDied()
  1517. sDied:play()
  1518. end
  1519.  
  1520. function onState(state, sound)
  1521. if state then
  1522. sound:play()
  1523. else
  1524. sound:pause()
  1525. end
  1526. end
  1527.  
  1528. function onRunning(speed)
  1529. if speed>0 then
  1530. sRunning:play()
  1531. else
  1532. sRunning:pause()
  1533. end
  1534. end
  1535.  
  1536.  
  1537. Humanoid.Died:connect(onDied)
  1538. Humanoid.Running:connect(onRunning)
  1539. Humanoid.Jumping:connect(function(state) onState(state, sJumping) end)
  1540. Humanoid.GettingUp:connect(function(state) onState(state, sGettingUp) end)
  1541. Humanoid.FreeFalling:connect(function(state) onState(state, sFreeFalling) end)
  1542. Humanoid.FallingDown:connect(function(state) onState(state, sFallingDown) end)
  1543. --]]
  1544.  
  1545. local nextTime = 0
  1546. local runService = game:service("RunService");
  1547.  
  1548. while Figure.Parent~=nil do
  1549. time = runService.Stepped:wait()
  1550. if time > nextTime then
  1551. move(time)
  1552. nextTime = time + 0.1
  1553. end
  1554. end
  1555.  
  1556. end))
  1557. for i,v in pairs(mas:GetChildren()) do
  1558. v.Parent = workspace
  1559. pcall(function() v:MakeJoints() end)
  1560. end
  1561. mas:Destroy()
  1562. for i,v in pairs(cors) do
  1563. spawn(function()
  1564. pcall(v)
  1565. end)
  1566. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement