Advertisement
lafur

Untitled

Oct 22nd, 2018
146
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 38.36 KB | None | 0 0
  1. --Created by PenguinAnonymous (ttyyuu12345) Editied by Dittoide
  2. --What's Added To M2S with Dittoide's Edit?
  3. --/ Better dummy script function to improve compatibility (makes it like you are running the code inside the script.)
  4. --/ Removed Gui In Bottom-Left for when you are making guis.
  5. --/ Removed "Inserting Map Please Wait" gui when selected Workspace as Place to export.
  6. --Credit: PenguinAnonymous for making original script, i just wanted to iron it out to my liking.
  7. --Errors: Camera,Terrain
  8. local runDummyScript = function(f,scri)
  9. if (not scri:IsA('Script')) or (not scri:IsA('LocalScript')) then return false; end;
  10. local Dummy_CoRoutine = coroutine.create(function()
  11. getfenv().script = scri
  12. ypcall(function() f() end)
  13. end)
  14. table.insert(cors,Dummy_CoRoutine);
  15. coroutine.resume(Dummy_CoRoutine);
  16. end
  17. cors = {}
  18. mas = Instance.new("Model",game:GetService("Lighting"))
  19. mas.Name = "M2S_Model"
  20. o3 = Instance.new("Model")
  21. o4 = Instance.new("Part")
  22. o5 = Instance.new("SpecialMesh")
  23. o6 = Instance.new("Decal")
  24. o7 = Instance.new("Part")
  25. o8 = Instance.new("Motor")
  26. o9 = Instance.new("Snap")
  27. o10 = Instance.new("Motor")
  28. o11 = Instance.new("Motor")
  29. o12 = Instance.new("Motor")
  30. o13 = Instance.new("Part")
  31. o14 = Instance.new("Part")
  32. o15 = Instance.new("Part")
  33. o16 = Instance.new("Part")
  34. o17 = Instance.new("Humanoid")
  35. o18 = Instance.new("Script")
  36. o19 = Instance.new("IntValue")
  37. o20 = Instance.new("Script")
  38. o21 = Instance.new("Script")
  39. o22 = Instance.new("Script")
  40. o23 = Instance.new("BodyColors")
  41. o24 = Instance.new("Part")
  42. o25 = Instance.new("SpecialMesh")
  43. o26 = Instance.new("Script")
  44. o27 = Instance.new("Script")
  45. o3.Name = "Noob"
  46. o3.Parent = mas
  47. o4.Name = "Head"
  48. o4.Parent = o3
  49. o4.BrickColor = BrickColor.new("Bright yellow")
  50. o4.Position = Vector3.new(-33, 4.50002098, -24.5)
  51. o4.Rotation = Vector3.new(-180, 0, -180)
  52. o4.CanCollide = false
  53. o4.FormFactor = Enum.FormFactor.Symmetric
  54. o4.Size = Vector3.new(2, 1, 1)
  55. o4.CFrame = CFrame.new(-33, 4.50002098, -24.5, -1, 0, 0, 0, 1, 0, 0, 0, -1)
  56. o4.TopSurface = Enum.SurfaceType.Smooth
  57. o4.Color = Color3.new(0.960784, 0.803922, 0.188235)
  58. o4.Position = Vector3.new(-33, 4.50002098, -24.5)
  59. o5.Parent = o4
  60. o5.Scale = Vector3.new(1.25, 1.25, 1.25)
  61. o6.Parent = o4
  62. o6.Texture = "http://www.roblox.com/asset/?id=10521899"
  63. o7.Name = "Torso"
  64. o7.Parent = o3
  65. o7.BrickColor = BrickColor.new("Bright blue")
  66. o7.Position = Vector3.new(-33, 3.00002193, -24.5)
  67. o7.Rotation = Vector3.new(180, 0, -180)
  68. o7.CanCollide = false
  69. o7.FormFactor = Enum.FormFactor.Symmetric
  70. o7.Size = Vector3.new(2, 2, 1)
  71. o7.CFrame = CFrame.new(-33, 3.00002193, -24.5, -1, 0, -0, -0, 1, -0, -0, 0, -1)
  72. o7.Color = Color3.new(0.0509804, 0.411765, 0.67451)
  73. o7.Position = Vector3.new(-33, 3.00002193, -24.5)
  74. o8.Name = "Left Hip"
  75. o8.Parent = o7
  76. o8.C0 = CFrame.new(-1, -1, 0, 0, 0, -1, 0, 1, 0, 1, 0, 0)
  77. o8.C1 = CFrame.new(-0.5, 1, 0, -0, -0, -1, 0, 1, 0, 1, 0, 0)
  78. o8.DesiredAngle = -0.08036082983017
  79. o8.MaxVelocity = 0.10000000149012
  80. o9.Name = "Neck"
  81. o9.Parent = o7
  82. o9.C0 = CFrame.new(0, 1, 0, -1, -0, -0, 0, 0, 1, 0, 1, 0)
  83. o9.C1 = CFrame.new(0, -0.5, 0, -1, -0, -0, 0, 0, 1, 0, 1, 0)
  84. o10.Name = "Right Hip"
  85. o10.Parent = o7
  86. o10.C0 = CFrame.new(1, -1, 0, 0, 0, 1, 0, 1, 0, -1, 0, 0)
  87. o10.C1 = CFrame.new(0.5, 1, 0, 0, 0, 1, 0, 1, 0, -1, -0, -0)
  88. o10.DesiredAngle = -0.08036082983017
  89. o10.MaxVelocity = 0.10000000149012
  90. o11.Name = "Right Shoulder"
  91. o11.Parent = o7
  92. o11.C0 = CFrame.new(-2, 0.5, 0, 0, 0, 1, 0, 1, 0, -1, 0, 0)
  93. o11.C1 = CFrame.new(-0.5, 0.5, 0, 0, 0, 1, 0, 1, 0, -1, -0, -0)
  94. o11.DesiredAngle = -0.08036082983017
  95. o11.MaxVelocity = 0.15000000596046
  96. o12.Name = "Left Shoulder"
  97. o12.Parent = o7
  98. o12.C0 = CFrame.new(2, 0.5, 0, 0, 0, -1, 0, 1, 0, 1, 0, 0)
  99. o12.C1 = CFrame.new(0.5, 0.5, 0, -0, -0, -1, 0, 1, 0, 1, 0, 0)
  100. o12.DesiredAngle = 0.08036082983017
  101. o12.MaxVelocity = 0.15000000596046
  102. o13.Name = "Left Leg"
  103. o13.Parent = o3
  104. o13.BrickColor = BrickColor.new("Bright green")
  105. o13.Position = Vector3.new(-32.5, 1.00002301, -24.5)
  106. o13.Rotation = Vector3.new(180, 0, -180)
  107. o13.CanCollide = false
  108. o13.FormFactor = Enum.FormFactor.Symmetric
  109. o13.Size = Vector3.new(1, 2, 1)
  110. o13.CFrame = CFrame.new(-32.5, 1.00002301, -24.5, -1, 0, -0, -0, 1, -0, -0, 0, -1)
  111. o13.BottomSurface = Enum.SurfaceType.Smooth
  112. o13.Color = Color3.new(0.294118, 0.592157, 0.294118)
  113. o13.Position = Vector3.new(-32.5, 1.00002301, -24.5)
  114. o14.Name = "Right Leg"
  115. o14.Parent = o3
  116. o14.BrickColor = BrickColor.new("Bright green")
  117. o14.Position = Vector3.new(-33.5, 1.00002301, -24.5)
  118. o14.Rotation = Vector3.new(180, 0, -180)
  119. o14.CanCollide = false
  120. o14.FormFactor = Enum.FormFactor.Symmetric
  121. o14.Size = Vector3.new(1, 2, 1)
  122. o14.CFrame = CFrame.new(-33.5, 1.00002301, -24.5, -1, 0, -0, -0, 1, -0, -0, 0, -1)
  123. o14.BottomSurface = Enum.SurfaceType.Smooth
  124. o14.Color = Color3.new(0.294118, 0.592157, 0.294118)
  125. o14.Position = Vector3.new(-33.5, 1.00002301, -24.5)
  126. o15.Name = "Right Arm"
  127. o15.Parent = o3
  128. o15.BrickColor = BrickColor.new("Bright yellow")
  129. o15.Position = Vector3.new(-34.5, 3.00002193, -24.5)
  130. o15.Rotation = Vector3.new(180, 0, -180)
  131. o15.CanCollide = false
  132. o15.FormFactor = Enum.FormFactor.Symmetric
  133. o15.Size = Vector3.new(1, 2, 1)
  134. o15.CFrame = CFrame.new(-34.5, 3.00002193, -24.5, -1, 0, -0, -0, 1, -0, -0, 0, -1)
  135. o15.Color = Color3.new(0.960784, 0.803922, 0.188235)
  136. o15.Position = Vector3.new(-34.5, 3.00002193, -24.5)
  137. o16.Name = "Left Arm"
  138. o16.Parent = o3
  139. o16.BrickColor = BrickColor.new("Bright yellow")
  140. o16.Position = Vector3.new(-31.5, 3.00002193, -24.5)
  141. o16.Rotation = Vector3.new(180, 0, -180)
  142. o16.CanCollide = false
  143. o16.FormFactor = Enum.FormFactor.Symmetric
  144. o16.Size = Vector3.new(1, 2, 1)
  145. o16.CFrame = CFrame.new(-31.5, 3.00002193, -24.5, -1, 0, -0, -0, 1, -0, -0, 0, -1)
  146. o16.FrontSurface = Enum.SurfaceType.Weld
  147. o16.Color = Color3.new(0.960784, 0.803922, 0.188235)
  148. o16.Position = Vector3.new(-31.5, 3.00002193, -24.5)
  149. o17.Name = "Zombie"
  150. o17.Parent = o3
  151. o17.RightLeg = o14
  152. o17.LeftLeg = o13
  153. o17.Torso = o7
  154. o18.Name = "Robot"
  155. o18.Parent = o3
  156.  
  157. runDummyScript(function()
  158. model = script.Parent
  159. backup = model:Clone()
  160. regentime = 1 --5 minutes
  161.  
  162. ------------------
  163. --SPAWNING--
  164. ------------------
  165.  
  166. miked=script.Parent
  167.  
  168. itlh=miked.Torso:findFirstChild("Left Hip")
  169. itlh.Part0=miked.Torso
  170. itlh.Part1=miked:findFirstChild("Left Leg")
  171. itlh.C0=CFrame.new(-1, -1, 0, 0, 0, -1, 0, 1, 0, 1, 0, 0)
  172.  
  173. itrh=miked.Torso:findFirstChild("Right Hip")
  174. itrh.Part0=miked.Torso
  175. itrh.Part1=miked:findFirstChild("Right Leg")
  176. itrh.C0=CFrame.new(1, -1, 0, 0, 0, 1, 0, 1, 0, -1, 0, 0)
  177.  
  178. itls=miked.Torso:findFirstChild("Left Shoulder")
  179. itls.Part1=miked.Torso
  180. itls.C0=CFrame.new(2, 0.5, 0, 0, 0, -1, 0, 1, 0, 1, 0, 0)
  181. itls.Part0=miked:findFirstChild("Left Arm")
  182.  
  183. itrs=miked.Torso:findFirstChild("Right Shoulder")
  184. itrs.Part1=miked.Torso
  185. itrs.C0=CFrame.new(-2, 0.5, 0, 0, 0, 1, 0, 1, 0, -1, 0, 0)
  186. itrs.Part0=miked:findFirstChild("Right Arm")
  187.  
  188. miked.Head:makeJoints()
  189. ------------------
  190. ------------------
  191.  
  192.  
  193. function waitForChild(parent, childName)
  194. while true do
  195. local child = parent:findFirstChild(childName)
  196. if child then
  197. return child
  198. end
  199. parent.ChildAdded:wait()
  200. end
  201. end
  202.  
  203. local Figure = script.Parent
  204. local Torso = waitForChild(Figure, "Torso")
  205. local RightShoulder = waitForChild(Torso, "Right Shoulder")
  206. local LeftShoulder = waitForChild(Torso, "Left Shoulder")
  207. local RightHip = waitForChild(Torso, "Right Hip")
  208. local LeftHip = waitForChild(Torso, "Left Hip")
  209. local Neck = waitForChild(Torso, "Neck")
  210. local Humanoid = waitForChild(Figure, "Zombie")
  211. local pose = "Standing"
  212.  
  213. local toolAnim = "None"
  214. local toolAnimTime = 0
  215.  
  216. local isSeated = false
  217.  
  218.  
  219. function onRunning(speed)
  220. if isSeated then return end
  221.  
  222. if speed>0 then
  223. pose = "Running"
  224. else
  225. pose = "Standing"
  226. end
  227. end
  228.  
  229. function onDied()
  230. pose = "Dead"
  231. wait(regentime)
  232. wait(1)
  233. model:remove()
  234. model = backup:Clone()
  235. wait(3)
  236. model.Parent = game.Workspace
  237. model:MakeJoints()
  238. end
  239.  
  240. function onJumping()
  241. isSeated = false
  242. pose = "Jumping"
  243. end
  244.  
  245. function onClimbing()
  246. pose = "Climbing"
  247. end
  248.  
  249. function onGettingUp()
  250. pose = "GettingUp"
  251. end
  252.  
  253. function onFreeFall()
  254. pose = "FreeFall"
  255. end
  256.  
  257. function onDancing()
  258. pose = "Dancing"
  259. end
  260.  
  261. function onFallingDown()
  262. pose = "FallingDown"
  263. end
  264.  
  265. function onSeated()
  266. isSeated = true
  267. pose = "Seated"
  268. end
  269.  
  270.  
  271.  
  272. function moveJump()
  273. RightShoulder.MaxVelocity = 1
  274. LeftShoulder.MaxVelocity = 1
  275. RightShoulder.DesiredAngle = -3.14
  276. LeftShoulder.DesiredAngle = -3.14
  277. RightHip.DesiredAngle = 0
  278. LeftHip.DesiredAngle = 0
  279. end
  280.  
  281. function moveFreeFall()
  282. RightShoulder.MaxVelocity = 0.5
  283. LeftShoulder.MaxVelocity = 0.5
  284. RightShoulder.DesiredAngle = -1
  285. LeftShoulder.DesiredAngle = -1
  286. RightHip.DesiredAngle = 0
  287. LeftHip.DesiredAngle = 0
  288. end
  289.  
  290. function moveFloat()
  291. RightShoulder.MaxVelocity = 0.5
  292. LeftShoulder.MaxVelocity = 0.5
  293. RightShoulder.DesiredAngle = -1.57
  294. LeftShoulder.DesiredAngle = 1.57
  295. RightHip.DesiredAngle = 1.57
  296. LeftHip.DesiredAngle = -1.57
  297. end
  298.  
  299. function moveBoogy()
  300. while pose=="Boogy" do
  301. wait(.5)
  302. RightShoulder.MaxVelocity = 1
  303. LeftShoulder.MaxVelocity = 1
  304. RightShoulder.DesiredAngle = -3.14
  305. LeftShoulder.DesiredAngle = 0
  306. RightHip.DesiredAngle = 1.57
  307. LeftHip.DesiredAngle = 0
  308. wait(.5)
  309. RightShoulder.MaxVelocity = 1
  310. LeftShoulder.MaxVelocity = 1
  311. RightShoulder.DesiredAngle = 0
  312. LeftShoulder.DesiredAngle = -3.14
  313. RightHip.DesiredAngle = 0
  314. LeftHip.DesiredAngle = 1.57
  315. end
  316. end
  317.  
  318. function moveZombie()
  319. RightShoulder.MaxVelocity = 0.5
  320. LeftShoulder.MaxVelocity = 0.5
  321. RightShoulder.DesiredAngle = -1.57
  322. LeftShoulder.DesiredAngle = 1.57
  323. RightHip.DesiredAngle = 0
  324. LeftHip.DesiredAngle = 0
  325. end
  326.  
  327. function movePunch()
  328. script.Parent.Torso.Anchored=true
  329. RightShoulder.MaxVelocity = 60
  330. LeftShoulder.MaxVelocity = 0.5
  331. RightShoulder.DesiredAngle = -1.57
  332. LeftShoulder.DesiredAngle = 0
  333. RightHip.DesiredAngle = 0
  334. LeftHip.DesiredAngle = 0
  335. wait(1)
  336. script.Parent.Torso.Anchored=false
  337. pose="Standing"
  338.  
  339. end
  340.  
  341. function moveKick()
  342. RightShoulder.MaxVelocity = 0.5
  343. LeftShoulder.MaxVelocity = 0.5
  344. RightShoulder.DesiredAngle = 0
  345. LeftShoulder.DesiredAngle = 0
  346. RightHip.MaxVelocity = 40
  347. RightHip.DesiredAngle = 1.57
  348. LeftHip.DesiredAngle = 0
  349. wait(1)
  350. pose="Standing"
  351.  
  352. end
  353.  
  354. function moveFly()
  355. RightShoulder.MaxVelocity = 0.5
  356. LeftShoulder.MaxVelocity = 0.5
  357. RightShoulder.DesiredAngle = 0
  358. LeftShoulder.DesiredAngle = 0
  359. RightHip.MaxVelocity = 40
  360. RightHip.DesiredAngle = 1.57
  361. LeftHip.DesiredAngle = 0
  362. wait(1)
  363. pose="Standing"
  364.  
  365. end
  366.  
  367.  
  368. function moveClimb()
  369. RightShoulder.MaxVelocity = 0.5
  370. LeftShoulder.MaxVelocity = 0.5
  371. RightShoulder.DesiredAngle = -3.14
  372. LeftShoulder.DesiredAngle = 3.14
  373. RightHip.DesiredAngle = 0
  374. LeftHip.DesiredAngle = 0
  375. end
  376.  
  377. function moveSit()
  378. RightShoulder.MaxVelocity = 0.15
  379. LeftShoulder.MaxVelocity = 0.15
  380. RightShoulder.DesiredAngle = -3.14 /2
  381. LeftShoulder.DesiredAngle = -3.14 /2
  382. RightHip.DesiredAngle = 3.14 /2
  383. LeftHip.DesiredAngle = -3.14 /2
  384. end
  385.  
  386. function getTool()
  387.  
  388. kidTable = Figure:children()
  389. if (kidTable ~= nil) then
  390. numKids = #kidTable
  391. for i=1,numKids do
  392. if (kidTable[i].className == "Tool") then return kidTable[i] end
  393. end
  394. end
  395.  
  396. return nil
  397. end
  398.  
  399. function getToolAnim(tool)
  400.  
  401. c = tool:children()
  402. for i=1,#c do
  403. if (c[i].Name == "toolanim" and c[i].className == "StringValue") then
  404. return c[i]
  405. end
  406. end
  407. return nil
  408. end
  409.  
  410. function animateTool()
  411.  
  412. if (toolAnim == "None") then
  413. RightShoulder.DesiredAngle = -1.57
  414. return
  415. end
  416.  
  417. if (toolAnim == "Slash") then
  418. RightShoulder.MaxVelocity = 0.5
  419. RightShoulder.DesiredAngle = 0
  420. return
  421. end
  422.  
  423. if (toolAnim == "Lunge") then
  424. RightShoulder.MaxVelocity = 0.5
  425. LeftShoulder.MaxVelocity = 0.5
  426. RightHip.MaxVelocity = 0.5
  427. LeftHip.MaxVelocity = 0.5
  428. RightShoulder.DesiredAngle = -1.57
  429. LeftShoulder.DesiredAngle = 1.0
  430. RightHip.DesiredAngle = 1.57
  431. LeftHip.DesiredAngle = 1.0
  432. return
  433. end
  434. end
  435.  
  436. function move(time)
  437. local amplitude
  438. local frequency
  439.  
  440. if (pose == "Jumping") then
  441. moveJump()
  442. return
  443. end
  444.  
  445. if (pose == "Zombie") then
  446. moveZombie()
  447. return
  448. end
  449.  
  450. if (pose == "Boogy") then
  451. moveBoogy()
  452. return
  453. end
  454.  
  455. if (pose == "Float") then
  456. moveFloat()
  457. return
  458. end
  459.  
  460. if (pose == "Punch") then
  461. movePunch()
  462. return
  463. end
  464.  
  465. if (pose == "Kick") then
  466. moveKick()
  467. return
  468. end
  469.  
  470. if (pose == "Fly") then
  471. moveFly()
  472. return
  473. end
  474.  
  475. if (pose == "FreeFall") then
  476. moveFreeFall()
  477. return
  478. end
  479.  
  480. if (pose == "Climbing") then
  481. moveClimb()
  482. return
  483. end
  484.  
  485. if (pose == "Seated") then
  486. moveSit()
  487. return
  488. end
  489.  
  490. amplitude = 0.1
  491. frequency = 1
  492.  
  493. RightShoulder.MaxVelocity = 0.15
  494. LeftShoulder.MaxVelocity = 0.15
  495. if (pose == "Running") then
  496. amplitude = 1
  497. frequency = 9
  498. elseif (pose == "Dancing") then
  499. amplitude = 2
  500. frequency = 16
  501. end
  502.  
  503.  
  504. desiredAngle = amplitude * math.sin(time*frequency)
  505. if pose~="Dancing" then
  506. RightShoulder.DesiredAngle = -desiredAngle
  507. LeftShoulder.DesiredAngle = desiredAngle
  508. RightHip.DesiredAngle = -desiredAngle
  509. LeftHip.DesiredAngle = -desiredAngle
  510. else
  511. RightShoulder.DesiredAngle = desiredAngle
  512. LeftShoulder.DesiredAngle = desiredAngle
  513. RightHip.DesiredAngle = -desiredAngle
  514. LeftHip.DesiredAngle = -desiredAngle
  515. end
  516.  
  517.  
  518.  
  519. local tool = getTool()
  520.  
  521. if tool ~= nil then
  522.  
  523. animStringValueObject = getToolAnim(tool)
  524.  
  525. if animStringValueObject ~= nil then
  526. toolAnim = animStringValueObject.Value
  527. -- message recieved, delete StringValue
  528. animStringValueObject.Parent = nil
  529. toolAnimTime = time + .3
  530. end
  531.  
  532. if time > toolAnimTime then
  533. toolAnimTime = 0
  534. toolAnim = "None"
  535. end
  536.  
  537. animateTool()
  538.  
  539.  
  540. else
  541. toolAnim = "None"
  542. toolAnimTime = 0
  543. end
  544. end
  545.  
  546.  
  547. -- connect events
  548. -----------------------------------------------------------------------------------------------------------------------
  549.  
  550. function unequip()
  551. local items=script.Parent:children()
  552. for i=1, #items do
  553. if items[i].className=="Tool" then items[i]:remove() end
  554. end
  555. end
  556.  
  557. function onChatted(msg, recipient)
  558. msg = string.lower(msg)
  559.  
  560. if string.match(msg, string.lower(script.Parent.Name))~=nil or string.match(msg, "everyone") then
  561. if string.match(msg, "equip") then
  562. if game.Workspace:findFirstChild("Hub") then
  563. if string.match(msg, "rocket") then unequip()
  564. game.Workspace.Hub.Rocket:clone().Parent=script.Parent
  565. elseif string.match(msg, "slingshot") then unequip()
  566. game.Workspace.Hub.Slingshot:clone().Parent=script.Parent
  567. elseif string.match(msg, "sword") then unequip()
  568. game.Workspace.Hub.Sword:clone().Parent=script.Parent
  569. elseif string.match(msg, "pbg") then unequip()
  570. game.Workspace.Hub.PBG:clone().Parent=script.Parent
  571. elseif string.match(msg, "superball") then unequip()
  572. game.Workspace.Hub.Superball:clone().Parent=script.Parent
  573. elseif string.match(msg, "trowel") then unequip()
  574. game.Workspace.Hub.Trowel:clone().Parent=script.Parent
  575. elseif string.match(msg, "bomb") then unequip()
  576. game.Workspace.Hub.Bomb:clone().Parent=script.Parent
  577. end
  578. end
  579. end
  580. if string.match(msg, "unequip") then unequip() end
  581. if string.match(msg, "run") then onRunning(1) end
  582. if string.match(msg, "climb") then onClimbing() end
  583. if string.match(msg, "jump") then onJumping() end
  584. if string.match(msg, "zombie") then pose="Zombie" end
  585. if string.match(msg, "disco") then pose="Boogy" end
  586. if string.match(msg, "float") then pose="Float" end
  587. if string.match(msg, "punch") then pose="Punch" end
  588. if string.match(msg, "kick") then pose="Kick" end
  589. if string.match(msg, "fly") then pose="Fly" end
  590. if string.match(msg, "heal") then script.Parent.Humanoid.Health=script.Parent.Humanoid.MaxHealth end
  591. if string.match(msg, "defend") then defence() end
  592. if string.match(msg, "stop") then pose="Standing"; proxkill=false; following=false; stopmoving() end
  593. if string.match(msg, "go home") then following=false; gohome() end
  594. if string.match(msg, "follow") then
  595. if string.match(msg, "all") then
  596. followany()
  597. else
  598. local egg=game.Players:children()
  599. for i=1, #egg do
  600. if string.match(msg, string.lower(egg[i].Name)) then
  601. follow(egg[i].Name)
  602. return
  603. end
  604. end
  605. end
  606. end
  607. if string.match(msg, "kill") then
  608. if string.match(msg, "all") then
  609. attackany()
  610. else
  611. local egg=game.Players:children()
  612. for i=1, #egg do
  613. if string.match(msg, string.lower(egg[i].Name)) then
  614. attack(egg[i].Name)
  615. return
  616. end
  617. end
  618. end
  619. end
  620.  
  621. end
  622. end
  623.  
  624. if game.Players.NumPlayers>1 then
  625. x=game.Players:children()
  626.  
  627. for i=1, #x do
  628. if script.Parent:findFirstChild("Commander")~=nil then
  629. if script.Parent.Commander:children()~=nil or script.Parent.Commander:children()>0 then
  630. local ch=script.Parent.Commander:children()
  631. for i=1, #ch do
  632. if string.lower(ch[i].Name)==string.lower(x[i].Name) then
  633. x[i].Chatted:connect(function(msg, recipient) onChatted(msg, recipient) end)
  634. end
  635. end
  636. elseif string.lower(script.Parent.Commander.Value)==string.lower(x[i].Name) then
  637. x[i].Chatted:connect(function(msg, recipient) onChatted(msg, recipient) end)
  638. end
  639. else
  640. x[i].Chatted:connect(function(msg, recipient) onChatted(msg, recipient) end)
  641. end
  642. end
  643. end
  644.  
  645.  
  646. function onPlayerEntered(Player)
  647. while Player.Name==nil do
  648. wait(2)
  649. end
  650. if script.Parent:findFirstChild("Commander")~=nil then
  651. if script.Parent.Commander:children()~=nil or script.Parent.Commander:children()>0 then
  652. local ch=script.Parent.Commander:children()
  653. for i=1, #ch do
  654. if string.lower(ch[i].Name)==string.lower(Player.Name) then
  655. Player.Chatted:connect(function(msg, recipient) onChatted(msg, recipient) end)
  656. end
  657. end
  658. elseif string.lower(script.Parent.Commander.Value)==string.lower(Player.Name) then
  659. Player.Chatted:connect(function(msg, recipient) onChatted(msg, recipient) end)
  660. end
  661. else
  662. Player.Chatted:connect(function(msg, recipient) onChatted(msg, recipient) end)
  663. end
  664. end
  665.  
  666. game.Players.ChildAdded:connect(onPlayerEntered)
  667.  
  668.  
  669.  
  670. -----------------------------------------------------------------------------------------------------------------------
  671. -----------------------------------------------------------------------------------------------------------------------
  672. -----------------------------------------------------------------------------------------------------------------------
  673. -----------------------------------------------------------------------------------------------------------------------
  674. -----------------------------------------------------------------------------------------------------------------------
  675. -----------------------------------------------------------------------------------------------------------------------
  676. -----------------------------------------------------------------------------------------------------------------------
  677. -----------------------------------------------------------------------------------------------------------------------
  678. -----------------------------------------------------------------------------------------------------------------------
  679. -----------------------------------------------------------------------------------------------------------------------
  680. -----------------------------------------------------------------------------------------------------------------------
  681. -----------------------------------------------------------------------------------------------------------------------
  682. dist=20
  683.  
  684. function followany()
  685. following=true
  686. while following==true do
  687.  
  688. local ch=game.Players:children()
  689. for i=1, #ch do
  690. local l=game.Workspace:findFirstChild(ch[i].Name)
  691. if l~=nil then
  692. local s=l.Torso
  693. local p=l.Torso.Position
  694. local q=script.Parent.Torso.Position
  695. local d=math.sqrt( ((p.x-q.x)^2)+((p.y-q.y)^2)+((p.z-q.z)^2) )
  696. if smallest==nil then
  697. smallest=d
  698. target=s
  699. elseif d<smallest then
  700. smallest=d
  701. target=s
  702. end
  703. end
  704. end
  705.  
  706. if smallest==nil then stopmoving() return end
  707.  
  708. if smallest>6*dist then return end
  709.  
  710. script.Parent.Humanoid:MoveTo(target.Position, target)
  711.  
  712. wait(0.5)
  713. for i=1, 6 do
  714. if target.Parent.Humanoid.Health<1 then stopmoving() else wait(0.5) end
  715. end
  716. end
  717. end
  718.  
  719.  
  720.  
  721. function gohome()
  722. script.Parent.Humanoid:MoveTo(Vector3.new(0,0,0), game.Workspace.Bases.Base)
  723. end
  724. function stopmoving()
  725. script.Parent.Humanoid:MoveTo(script.Parent.Torso.Position, script.Parent.Torso)
  726. end
  727.  
  728. function follow(name)
  729. following=true
  730.  
  731. local p=game.Workspace:findFirstChild(name)
  732. if p==nil then return end
  733. while following==true do
  734. script.Parent.Humanoid:MoveTo(p.Torso.Position, p.Torso)
  735. wait(0.5)
  736. for i=1, 3 do
  737. if p.Humanoid.Health<1 then following=false; stopmoving() return end
  738. wait(0.5)
  739. end
  740. end
  741. end
  742.  
  743. function attack(name)
  744. if script.Parent:findFirstChild("Sword")~=nil then
  745. following=true
  746. local p=game.Workspace:findFirstChild(name)
  747. if p==nil then return end
  748. while following==true do
  749. script.Parent.Humanoid:MoveTo(p.Torso.Position, p.Torso)
  750. wait(0.5)
  751. for i=1, 3 do
  752. if p.Humanoid.Health<1 then following=false; stopmoving() return end
  753. local l=p.Torso.Position
  754. local q=script.Parent.Torso.Position
  755. local d=math.sqrt( ((l.x-q.x)^2)+((l.y-q.y)^2)+((l.z-q.z)^2) )
  756. if d<10 then
  757. script.Parent.Humanoid:MoveTo(p.Torso.Position, p.Torso); slash()
  758. if (q.y-l.y)>3 and (q.y-l.y)<7 then
  759. script.Parent.Humanoid:MoveTo(p.Torso.Position+Vector3.new(math.random(-4,4),0,math.random(-4,4)), p.Torso);
  760. end
  761. end
  762. wait(1)
  763. end
  764. end
  765. end
  766. end
  767.  
  768. function attackany()
  769. if script.Parent:findFirstChild("Sword")~=nil then
  770.  
  771. following=true
  772. while following==true do
  773.  
  774. local ch=game.Players:children()
  775. for i=1, #ch do
  776. local l=game.Workspace:findFirstChild(ch[i].Name)
  777. if l~=nil then
  778. local s=l.Torso
  779. local p=l.Torso.Position
  780. local q=script.Parent.Torso.Position
  781. local d=math.sqrt( ((p.x-q.x)^2)+((p.y-q.y)^2)+((p.z-q.z)^2) )
  782. if smallest==nil then
  783. smallest=d
  784. target=s
  785. elseif d<smallest then
  786. smallest=d
  787. target=s
  788. end
  789. end
  790. end
  791.  
  792. if smallest==nil then stopmoving() return end
  793.  
  794. if smallest>6*dist then return end
  795.  
  796. script.Parent.Humanoid:MoveTo(target.Position, target)
  797.  
  798. if smallest<10 then
  799. slash()
  800. end
  801. if target.Parent==nil then stopmoving() return end
  802. wait(0.5)
  803. for i=1, 3 do
  804. if target.Parent.Humanoid.Health<1 then
  805. stopmoving()
  806. else
  807. local p=target.Position
  808. local q=script.Parent.Torso.Position
  809. local d=math.sqrt( ((p.x-q.x)^2)+((p.y-q.y)^2)+((p.z-q.z)^2) )
  810. if d<10 then
  811. script.Parent.Humanoid:MoveTo(target.Position, target); slash()
  812. if (q.y-p.y)>3 and (q.y-p.y)<7 then
  813. script.Parent.Humanoid:MoveTo(p.Torso.Position+Vector3.new(math.random(-4,4),0,math.random(-4,4)), p.Torso);
  814. end
  815. end
  816. wait(1)
  817. end
  818. end
  819. end
  820. end
  821. end
  822.  
  823.  
  824. function patrol()
  825. if points==nil then
  826. points=0
  827. if game.Workspace:findFirstChild("pp1")~=nil then
  828. pp1=game.Workspace:findFirstChild("pp1")
  829. local points=points+1
  830. if game.Workspace:findFirstChild("pp2")~=nil then
  831. pp2=game.Workspace:findFirstChild("pp2")
  832. local points=points+1
  833. if game.Workspace:findFirstChild("pp3")~=nil then
  834. pp3=game.Workspace:findFirstChild("pp3")
  835. local points=points+1
  836. if game.Workspace:findFirstChild("pp4")~=nil then
  837. pp4=game.Workspace:findFirstChild("pp4")
  838. local points=points+1
  839. if game.Workspace:findFirstChild("pp5")~=nil then
  840. pp5=game.Workspace:findFirstChild("pp5")
  841. local points=points+1
  842. if game.Workspace:findFirstChild("pp6")~=nil then
  843. pp6=game.Workspace:findFirstChild("pp6")
  844. local points=points+1
  845. if game.Workspace:findFirstChild("pp7")~=nil then
  846. pp7=game.Workspace:findFirstChild("pp7")
  847. local points=points+1
  848. if game.Workspace:findFirstChild("pp8")~=nil then
  849. pp8=game.Workspace:findFirstChild("pp8")
  850. local points=points+1
  851. if game.Workspace:findFirstChild("pp9")~=nil then
  852. pp9=game.Workspace:findFirstChild("pp9")
  853. local points=points+1
  854. end
  855. end
  856. end
  857. end
  858. end
  859. end
  860. end
  861. end
  862. end
  863. end
  864.  
  865. if points<1 then return end
  866. patrolling=true
  867. local time=2
  868. if points==1 then return end
  869. if points>1 then
  870. while patrolling==true do
  871. script.Parent.Humanoid:MoveTo(pp1.Position, pp1)
  872. wait(time)
  873. script.Parent.Humanoid:MoveTo(pp2.Position, pp2)
  874. wait(time)
  875. if points>2 then
  876. script.Parent.Humanoid:MoveTo(pp3.Position, pp3)
  877. wait(time)
  878. if points>3 then
  879. script.Parent.Humanoid:MoveTo(pp4.Position, pp4)
  880. wait(time)
  881. if points>4 then
  882. script.Parent.Humanoid:MoveTo(pp5.Position, pp5)
  883. wait(time)
  884. if points>5 then
  885. script.Parent.Humanoid:MoveTo(pp6.Position, pp6)
  886. wait(time)
  887. if points>6 then
  888. script.Parent.Humanoid:MoveTo(pp7.Position, pp7)
  889. wait(time)
  890. if points>7 then
  891. script.Parent.Humanoid:MoveTo(pp8.Position, pp8)
  892. wait(time)
  893. if points>8 then
  894. script.Parent.Humanoid:MoveTo(pp9.Position, pp9)
  895. wait(time)
  896. end
  897. end
  898. end
  899. end
  900. end
  901. end
  902. end
  903. end
  904. end
  905. end
  906.  
  907.  
  908. function goto(pos,part)
  909. while true do
  910. end
  911. end
  912.  
  913.  
  914. function slash()
  915. for i=1, 3 do
  916. wait(.3)
  917. RightShoulder.MaxVelocity = 2
  918. LeftShoulder.MaxVelocity = 1
  919. RightShoulder.DesiredAngle = -2.14
  920. LeftShoulder.DesiredAngle = 0
  921. RightHip.DesiredAngle = 0
  922. LeftHip.DesiredAngle = 0
  923. wait(.2)
  924. RightShoulder.MaxVelocity = 2
  925. LeftShoulder.MaxVelocity = 1
  926. RightShoulder.DesiredAngle = 0
  927. LeftShoulder.DesiredAngle = 0
  928. RightHip.DesiredAngle = 0
  929. LeftHip.DesiredAngle = 0
  930. end
  931. end
  932.  
  933. function defence()
  934. proxkill=true
  935. while proxkill==true do
  936. local ch=game.Players:children()
  937. for i=1, #ch do
  938. local p=game.Workspace:findFirstChild(ch[i].Name)
  939. if p~=nil then
  940. local p=p.Torso.Position
  941. local q=script.Parent.Torso.Position
  942. local d=math.sqrt( ((p.x-q.x)^2)+((p.y-q.y)^2)+((p.z-q.z)^2) )
  943. if d<dist and d>8 then
  944. local ex=Instance.new("Explosion")
  945. ex.Position=p
  946. ex.Parent=game.Workspace
  947. end
  948. end
  949. end
  950. wait(1)
  951. end
  952. end
  953.  
  954.  
  955.  
  956.  
  957. -----------------------------------------------------------------------------------------------------------------------
  958. -----------------------------------------------------------------------------------------------------------------------
  959. -----------------------------------------------------------------------------------------------------------------------
  960. -----------------------------------------------------------------------------------------------------------------------
  961. -----------------------------------------------------------------------------------------------------------------------
  962. -----------------------------------------------------------------------------------------------------------------------
  963. -----------------------------------------------------------------------------------------------------------------------
  964. -----------------------------------------------------------------------------------------------------------------------
  965. -----------------------------------------------------------------------------------------------------------------------
  966. -----------------------------------------------------------------------------------------------------------------------
  967. -----------------------------------------------------------------------------------------------------------------------
  968. -----------------------------------------------------------------------------------------------------------------------
  969.  
  970.  
  971. Humanoid.Died:connect(onDied)
  972. Humanoid.Running:connect(onRunning)
  973. Humanoid.Jumping:connect(onJumping)
  974. Humanoid.Climbing:connect(onClimbing)
  975. Humanoid.GettingUp:connect(onGettingUp)
  976. Humanoid.FreeFalling:connect(onFreeFall)
  977. Humanoid.FallingDown:connect(onFallingDown)
  978. Humanoid.Seated:connect(onSeated)
  979.  
  980.  
  981. --[[
  982.  
  983. function newSound(id)
  984. local sound = Instance.new("Sound")
  985. sound.SoundId = id
  986. sound.Parent = script.Parent.Head
  987. return sound
  988. end
  989.  
  990.  
  991. local sDied = newSound("rbxasset://sounds/uuhhh.wav")
  992. local sFallingDown = newSound("rbxasset://sounds/splat.wav")
  993. local sFreeFalling = newSound("rbxasset://sounds/swoosh.wav")
  994. local sGettingUp = newSound("rbxasset://sounds/hit.wav")
  995. local sJumping = newSound("rbxasset://sounds/button.wav")
  996. local sRunning = newSound("rbxasset://sounds/bfsl-minifigfoots1.mp3")
  997. sRunning.Looped = true
  998.  
  999. local Figure = script.Parent
  1000. local Head = waitForChild(Figure, "Head")
  1001. local Humanoid = waitForChild(Figure, "Humanoid")
  1002.  
  1003.  
  1004. function onDied()
  1005. sDied:play()
  1006. end
  1007.  
  1008. function onState(state, sound)
  1009. if state then
  1010. sound:play()
  1011. else
  1012. sound:pause()
  1013. end
  1014. end
  1015.  
  1016. function onRunning(speed)
  1017. if speed>0 then
  1018. sRunning:play()
  1019. else
  1020. sRunning:pause()
  1021. end
  1022. end
  1023.  
  1024.  
  1025. Humanoid.Died:connect(onDied)
  1026. Humanoid.Running:connect(onRunning)
  1027. Humanoid.Jumping:connect(function(state) onState(state, sJumping) end)
  1028. Humanoid.GettingUp:connect(function(state) onState(state, sGettingUp) end)
  1029. Humanoid.FreeFalling:connect(function(state) onState(state, sFreeFalling) end)
  1030. Humanoid.FallingDown:connect(function(state) onState(state, sFallingDown) end)
  1031. --]]
  1032.  
  1033. local nextTime = 0
  1034. local runService = game:service("RunService");
  1035.  
  1036. while Figure.Parent~=nil do
  1037. time = runService.Stepped:wait()
  1038. if time > nextTime then
  1039. move(time)
  1040. nextTime = time + 0.1
  1041. end
  1042. end
  1043.  
  1044. end,o18)
  1045.  
  1046. o19.Name = "Mode"
  1047. o19.Parent = o3
  1048. o20.Parent = o3
  1049.  
  1050. runDummyScript(function()
  1051. function OnDeath()
  1052. if (math.random(1,2) == 1) then
  1053. local p = Instance.new("Part")
  1054. p.Parent = script.Parent
  1055. p.Position = Vector3.new (script.Parent.Torso.Position.x + math.random(-1,1), script.Parent.Torso.Position.y + math.random(-1,1), script.Parent.Torso.Position.z + math.random(-1,1))
  1056. p.BrickColor = BrickColor.new(21)
  1057. p.Transparency = 0.1
  1058. p.formFactor = 2
  1059. p.TopSurface = 1
  1060. p.BottomSurface = 1
  1061. p.Size = Vector3.new (1, 0.4, 1)
  1062. end
  1063. if (math.random(1,2) == 1) then
  1064. local p = Instance.new("Part")
  1065. p.Parent = script.Parent
  1066. p.Position = Vector3.new (script.Parent.Torso.Position.x + math.random(-1,1), script.Parent.Torso.Position.y + math.random(-1,1), script.Parent.Torso.Position.z + math.random(-1,1))
  1067. p.BrickColor = BrickColor.new(21)
  1068. p.Transparency = 0.1
  1069. p.formFactor = 2
  1070. p.TopSurface = 1
  1071. p.BottomSurface = 1
  1072. p.Size = Vector3.new (1, 0.4, 1)
  1073. end
  1074. if (math.random(1,2) == 1) then
  1075. local p = Instance.new("Part")
  1076. p.Parent = script.Parent
  1077. p.Position = Vector3.new (script.Parent.Torso.Position.x + math.random(-1,1), script.Parent.Torso.Position.y + math.random(-1,1), script.Parent.Torso.Position.z + math.random(-1,1))
  1078. p.BrickColor = BrickColor.new(21)
  1079. p.Transparency = 0.1
  1080. p.formFactor = 2
  1081. p.TopSurface = 1
  1082. p.BottomSurface = 1
  1083. p.Size = Vector3.new (1, 0.4, 1)
  1084. end
  1085. if (math.random(1,2) == 1) then
  1086. local p = Instance.new("Part")
  1087. p.Parent = script.Parent
  1088. p.Position = Vector3.new (script.Parent.Torso.Position.x + math.random(-1,1), script.Parent.Torso.Position.y + math.random(-1,1), script.Parent.Torso.Position.z + math.random(-1,1))
  1089. p.BrickColor = BrickColor.new(21)
  1090. p.Transparency = 0.1
  1091. p.formFactor = 2
  1092. p.TopSurface = 1
  1093. p.BottomSurface = 1
  1094. p.Size = Vector3.new (1, 0.4, 1)
  1095. end
  1096. if (math.random(1,2) == 1) then
  1097. local p = Instance.new("Part")
  1098. p.Parent = script.Parent
  1099. p.Position = Vector3.new (script.Parent.Torso.Position.x + math.random(-1,1), script.Parent.Torso.Position.y + math.random(-1,1), script.Parent.Torso.Position.z + math.random(-1,1))
  1100. p.BrickColor = BrickColor.new(21)
  1101. p.Transparency = 0.1
  1102. p.formFactor = 2
  1103. p.TopSurface = 1
  1104. p.BottomSurface = 1
  1105. p.Size = Vector3.new (1, 0.4, 1)
  1106. end
  1107. if (math.random(1,2) == 1) then
  1108. local p = Instance.new("Part")
  1109. p.Parent = script.Parent
  1110. p.Position = Vector3.new (script.Parent.Torso.Position.x + math.random(-1,1), script.Parent.Torso.Position.y + math.random(-1,1), script.Parent.Torso.Position.z + math.random(-1,1))
  1111. p.BrickColor = BrickColor.new(21)
  1112. p.Transparency = 0.1
  1113. p.formFactor = 2
  1114. p.TopSurface = 1
  1115. p.BottomSurface = 1
  1116. p.Size = Vector3.new (1, 0.4, 1)
  1117. end
  1118. if (math.random(1,2) == 1) then
  1119. local p = Instance.new("Part")
  1120. p.Parent = script.Parent
  1121. p.Position = Vector3.new (script.Parent.Torso.Position.x + math.random(-1,1), script.Parent.Torso.Position.y + math.random(-1,1), script.Parent.Torso.Position.z + math.random(-1,1))
  1122. p.BrickColor = BrickColor.new(21)
  1123. p.Transparency = 0.1
  1124. p.formFactor = 2
  1125. p.TopSurface = 1
  1126. p.BottomSurface = 1
  1127. p.Size = Vector3.new (1, 0.4, 1)
  1128. end
  1129. if (math.random(1,2) == 1) then
  1130. local p = Instance.new("Part")
  1131. p.Parent = script.Parent
  1132. p.Position = Vector3.new (script.Parent.Torso.Position.x + math.random(-1,1), script.Parent.Torso.Position.y + math.random(-1,1), script.Parent.Torso.Position.z + math.random(-1,1))
  1133. p.BrickColor = BrickColor.new(21)
  1134. p.Transparency = 0.1
  1135. p.formFactor = 2
  1136. p.TopSurface = 1
  1137. p.BottomSurface = 1
  1138. p.Size = Vector3.new (1, 0.4, 1)
  1139. end
  1140. if (math.random(1,2) == 1) then
  1141. local p = Instance.new("Part")
  1142. p.Parent = script.Parent
  1143. p.Position = Vector3.new (script.Parent.Torso.Position.x + math.random(-1,1), script.Parent.Torso.Position.y + math.random(-1,1), script.Parent.Torso.Position.z + math.random(-1,1))
  1144. p.BrickColor = BrickColor.new(21)
  1145. p.Transparency = 0.1
  1146. p.formFactor = 2
  1147. p.TopSurface = 1
  1148. p.BottomSurface = 1
  1149. p.Size = Vector3.new (1, 0.4, 1)
  1150. end
  1151. if (math.random(1,2) == 1) then
  1152. local p = Instance.new("Part")
  1153. p.Parent = script.Parent
  1154. p.Position = Vector3.new (script.Parent.Torso.Position.x + math.random(-1,1), script.Parent.Torso.Position.y + math.random(-1,1), script.Parent.Torso.Position.z + math.random(-1,1))
  1155. p.BrickColor = BrickColor.new(21)
  1156. p.Transparency = 0.1
  1157. p.formFactor = 2
  1158. p.TopSurface = 1
  1159. p.BottomSurface = 1
  1160. p.Size = Vector3.new (1, 0.4, 1)
  1161. end
  1162. end
  1163. script.Parent.Zombie.Died:connect(OnDeath)
  1164. end,o20)
  1165.  
  1166. o21.Name = "Respawn"
  1167. o21.Parent = o3
  1168.  
  1169. runDummyScript(function()
  1170. name="Zombie"
  1171.  
  1172. robo=script.Parent:clone()
  1173.  
  1174. while true do
  1175. wait(1)
  1176. if script.Parent.Zombie.Health<1 then
  1177. robot=robo:clone()
  1178. robot.Parent=script.Parent.Parent
  1179. robot:makeJoints()
  1180. script.Parent:remove()
  1181. end
  1182. end
  1183.  
  1184.  
  1185.  
  1186.  
  1187. end,o21)
  1188.  
  1189. o22.Parent = o3
  1190.  
  1191. runDummyScript(function()
  1192. local larm = script.Parent:FindFirstChild("Left Arm")
  1193. local rarm = script.Parent:FindFirstChild("Right Arm")
  1194.  
  1195. function findNearestTorso(pos)
  1196. local list = game.Workspace:children()
  1197. local torso = nil
  1198. local dist = 1000
  1199. local temp = nil
  1200. local human = nil
  1201. local temp2 = nil
  1202. for x = 1, #list do
  1203. temp2 = list[x]
  1204. if (temp2.className == "Model") and (temp2 ~= script.Parent) then
  1205. temp = temp2:findFirstChild("Torso")
  1206. human = temp2:findFirstChild("Humanoid")
  1207. if (temp ~= nil) and (human ~= nil) and (human.Health > 0) then
  1208. if (temp.Position - pos).magnitude < dist then
  1209. torso = temp
  1210. dist = (temp.Position - pos).magnitude
  1211. end
  1212. end
  1213. end
  1214. end
  1215. return torso
  1216. end
  1217.  
  1218. function Hit(hit)
  1219. local human = hit.Parent:FindFirstChild("Humanoid")
  1220. if human ~= nil then
  1221. wait(4)
  1222. human.Health = human.Health -2
  1223. wait(4)
  1224. human.Health = human.Health -2
  1225. wait(4)
  1226. human.Health = human.Health -2
  1227. wait(4)
  1228. human.Health = human.Health -2
  1229. wait(4)
  1230. human.Health = human.Health -2
  1231. end
  1232. end
  1233.  
  1234. larm.Touched:connect(Hit)
  1235. rarm.Touched:connect(Hit)
  1236.  
  1237. while true do
  1238. wait(0.1)
  1239. local target = findNearestTorso(script.Parent.Torso.Position)
  1240. if target ~= nil then
  1241. script.Parent.Zombie:MoveTo(target.Position, target)
  1242. end
  1243. end
  1244.  
  1245. end,o22)
  1246.  
  1247. o23.Parent = o3
  1248. o23.HeadColor = BrickColor.new("Bright yellow")
  1249. o23.LeftArmColor = BrickColor.new("Bright yellow")
  1250. o23.LeftLegColor = BrickColor.new("Bright green")
  1251. o23.RightArmColor = BrickColor.new("Bright yellow")
  1252. o23.RightLegColor = BrickColor.new("Bright green")
  1253. o23.TorsoColor = BrickColor.new("Bright blue")
  1254. o24.Name = "Handle"
  1255. o24.Parent = o3
  1256. o24.BrickColor = BrickColor.new("Dark stone grey")
  1257. o24.Reflectance = 0.40000000596046
  1258. o24.Position = Vector3.new(-31.5999985, 2.50002193, -23)
  1259. o24.Rotation = Vector3.new(0, 0, -90)
  1260. o24.FormFactor = Enum.FormFactor.Plate
  1261. o24.Size = Vector3.new(1, 0.800000012, 2)
  1262. o24.CFrame = CFrame.new(-31.5999985, 2.50002193, -23, -0, 1, 0, -1, 0, 0, -0, 0, 1)
  1263. o24.BackSurface = Enum.SurfaceType.Weld
  1264. o24.BottomSurface = Enum.SurfaceType.Weld
  1265. o24.FrontSurface = Enum.SurfaceType.Weld
  1266. o24.LeftSurface = Enum.SurfaceType.Weld
  1267. o24.RightSurface = Enum.SurfaceType.Weld
  1268. o24.TopSurface = Enum.SurfaceType.Weld
  1269. o24.Color = Color3.new(0.388235, 0.372549, 0.384314)
  1270. o24.Position = Vector3.new(-31.5999985, 2.50002193, -23)
  1271. o25.Parent = o24
  1272. o25.MeshId = "rbxasset://fonts/sword.mesh"
  1273. o25.TextureId = "rbxasset://textures/SwordTexture.png"
  1274. o25.MeshType = Enum.MeshType.FileMesh
  1275. o26.Name = "Deadly"
  1276. o26.Parent = o24
  1277.  
  1278. runDummyScript(function()
  1279. function onTouched(hit)
  1280. local human = hit.Parent:findFirstChild("Humanoid")
  1281. if (human ~= nil) then
  1282. human.Health = human.Health - 30
  1283. end
  1284. end
  1285.  
  1286. --if (script.Parent ~= nil) and (script.Parent.className == "Part") then --Work if in a block
  1287. -- connection = script.Parent.Touched:connect(onTouched)
  1288. --end
  1289. script.Parent.Touched:connect(onTouched)
  1290.  
  1291. end,o26)
  1292.  
  1293. o27.Name = "Jump"
  1294. o27.Parent = o3
  1295.  
  1296. runDummyScript(function()
  1297. while true do
  1298. wait(math.random(1,2))
  1299. script.Parent.Zombie.Jump = true
  1300. end
  1301.  
  1302. end,o27)
  1303.  
  1304. mas.Parent = workspace
  1305. mas:MakeJoints()
  1306. local mas1 = mas:GetChildren()
  1307. for i=1,#mas1 do
  1308. mas1[i].Parent = workspace
  1309. ypcall(function() mas1[i]:MakeJoints() end)
  1310. end
  1311. mas:Destroy()
  1312. for i=1,#cors do
  1313. coroutine.resume(cors[i])
  1314. end
  1315. mess_handle.Text = "Resetting"
  1316. for i,v in pairs(game:GetService("Players"):GetPlayers()) do
  1317. v:LoadCharacter()
  1318. end
  1319. wait(1)
  1320. mess_handle:Remove()
  1321.  
  1322. game:GetService("Lighting").Ambient = Color3.new(0, 0, 0)
  1323. game:GetService("Lighting").Brightness = 1
  1324. game:GetService("Lighting").ColorShift_Bottom = Color3.new(0, 0, 0)
  1325. game:GetService("Lighting").ColorShift_Top = Color3.new(0, 0, 0)
  1326. game:GetService("Lighting").GlobalShadows = true
  1327. game:GetService("Lighting").OutdoorAmbient = Color3.new(0.5, 0.5, 0.5)
  1328. game:GetService("Lighting").Outlines = false
  1329. game:GetService("Lighting").GeographicLatitude = 41.733299255371
  1330. game:GetService("Lighting").TimeOfDay = "14:00:00"
  1331. game:GetService("Lighting").FogColor = Color3.new(0.75, 0.75, 0.75)
  1332. game:GetService("Lighting").FogEnd = 100000
  1333. game:GetService("Lighting").FogStart = 0
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement