Advertisement
Rufus14

Gun NPC (SERVERSIDED)

Dec 28th, 2018
2,086
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 41.76 KB | None | 0 0
  1. --By Rufus14
  2. --Converted with ttyyuu12345's model to script plugin v4
  3. function sandbox(var,func)
  4.     local env = getfenv(func)
  5.     local newenv = setmetatable({},{
  6.         __index = function(self,k)
  7.             if k=="script" then
  8.                 return var
  9.             else
  10.                 return env[k]
  11.             end
  12.         end,
  13.     })
  14.     setfenv(func,newenv)
  15.     return func
  16. end
  17. cors = {}
  18. mas = Instance.new("Model",game:GetService("Lighting"))
  19. Model0 = Instance.new("Model")
  20. Part1 = Instance.new("Part")
  21. SpecialMesh2 = Instance.new("SpecialMesh")
  22. Sound3 = Instance.new("Sound")
  23. RemoteEvent4 = Instance.new("RemoteEvent")
  24. Sound5 = Instance.new("Sound")
  25. RemoteEvent6 = Instance.new("RemoteEvent")
  26. Sound7 = Instance.new("Sound")
  27. RemoteEvent8 = Instance.new("RemoteEvent")
  28. Sound9 = Instance.new("Sound")
  29. RemoteEvent10 = Instance.new("RemoteEvent")
  30. Sound11 = Instance.new("Sound")
  31. RemoteEvent12 = Instance.new("RemoteEvent")
  32. Sound13 = Instance.new("Sound")
  33. RemoteEvent14 = Instance.new("RemoteEvent")
  34. Sound15 = Instance.new("Sound")
  35. RemoteEvent16 = Instance.new("RemoteEvent")
  36. Sound17 = Instance.new("Sound")
  37. RemoteEvent18 = Instance.new("RemoteEvent")
  38. Sound19 = Instance.new("Sound")
  39. RemoteEvent20 = Instance.new("RemoteEvent")
  40. Decal21 = Instance.new("Decal")
  41. Sound22 = Instance.new("Sound")
  42. Sound23 = Instance.new("Sound")
  43. Weld24 = Instance.new("Weld")
  44. Weld25 = Instance.new("Weld")
  45. Part26 = Instance.new("Part")
  46. Decal27 = Instance.new("Decal")
  47. Motor6D28 = Instance.new("Motor6D")
  48. Motor6D29 = Instance.new("Motor6D")
  49. Motor6D30 = Instance.new("Motor6D")
  50. Motor6D31 = Instance.new("Motor6D")
  51. Motor6D32 = Instance.new("Motor6D")
  52. Part33 = Instance.new("Part")
  53. Part34 = Instance.new("Part")
  54. Part35 = Instance.new("Part")
  55. Part36 = Instance.new("Part")
  56. Humanoid37 = Instance.new("Humanoid")
  57. Part38 = Instance.new("Part")
  58. Motor6D39 = Instance.new("Motor6D")
  59. Script40 = Instance.new("Script")
  60. BodyColors41 = Instance.new("BodyColors")
  61. Accessory42 = Instance.new("Accessory")
  62. Part43 = Instance.new("Part")
  63. SpecialMesh44 = Instance.new("SpecialMesh")
  64. Vector3Value45 = Instance.new("Vector3Value")
  65. Weld46 = Instance.new("Weld")
  66. Accessory47 = Instance.new("Accessory")
  67. Hat48 = Instance.new("Hat")
  68. Part49 = Instance.new("Part")
  69. SpecialMesh50 = Instance.new("SpecialMesh")
  70. Hat51 = Instance.new("Hat")
  71. Part52 = Instance.new("Part")
  72. SpecialMesh53 = Instance.new("SpecialMesh")
  73. Shirt54 = Instance.new("Shirt")
  74. Pants55 = Instance.new("Pants")
  75. Part56 = Instance.new("Part")
  76. SpecialMesh57 = Instance.new("SpecialMesh")
  77. Sound58 = Instance.new("Sound")
  78. Script59 = Instance.new("Script")
  79. Model0.Name = "Gun NPC"
  80. Model0.Parent = mas
  81. Model0.PrimaryPart = Part1
  82. Part1.Name = "Head"
  83. Part1.Parent = Model0
  84. Part1.CFrame = CFrame.new(4.00040197, 36.3000336, -104.303101, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  85. Part1.Position = Vector3.new(4.00040197, 36.3000336, -104.303101)
  86. Part1.Color = Color3.new(1, 0.8, 0.6)
  87. Part1.Size = Vector3.new(2, 1, 1)
  88. Part1.BrickColor = BrickColor.new("Pastel brown")
  89. Part1.TopSurface = Enum.SurfaceType.Smooth
  90. Part1.brickColor = BrickColor.new("Pastel brown")
  91. Part1.FormFactor = Enum.FormFactor.Symmetric
  92. Part1.formFactor = Enum.FormFactor.Symmetric
  93. SpecialMesh2.Parent = Part1
  94. SpecialMesh2.Scale = Vector3.new(1.25, 1.25, 1.25)
  95. Sound3.Name = "GettingUp"
  96. Sound3.Parent = Part1
  97. Sound3.MaxDistance = 150
  98. Sound3.EmitterSize = 5
  99. Sound3.MinDistance = 5
  100. Sound3.SoundId = "rbxasset://sounds/action_get_up.mp3"
  101. Sound3.Volume = 0.64999997615814
  102. RemoteEvent4.Name = "CharacterSoundEvent"
  103. RemoteEvent4.Parent = Sound3
  104. Sound5.Name = "Died"
  105. Sound5.Parent = Part1
  106. Sound5.MaxDistance = 150
  107. Sound5.EmitterSize = 5
  108. Sound5.MinDistance = 5
  109. Sound5.SoundId = "rbxasset://sounds/uuhhh.mp3"
  110. Sound5.Volume = 0.64999997615814
  111. RemoteEvent6.Name = "CharacterSoundEvent"
  112. RemoteEvent6.Parent = Sound5
  113. Sound7.Name = "FreeFalling"
  114. Sound7.Parent = Part1
  115. Sound7.Looped = true
  116. Sound7.TimePosition = 0.23687450328543
  117. Sound7.MaxDistance = 150
  118. Sound7.EmitterSize = 5
  119. Sound7.MinDistance = 5
  120. Sound7.SoundId = "rbxasset://sounds/action_falling.mp3"
  121. Sound7.Volume = 0
  122. RemoteEvent8.Name = "CharacterSoundEvent"
  123. RemoteEvent8.Parent = Sound7
  124. Sound9.Name = "Jumping"
  125. Sound9.Parent = Part1
  126. Sound9.MaxDistance = 150
  127. Sound9.EmitterSize = 5
  128. Sound9.MinDistance = 5
  129. Sound9.SoundId = "rbxasset://sounds/action_jump.mp3"
  130. Sound9.Volume = 0.64999997615814
  131. RemoteEvent10.Name = "CharacterSoundEvent"
  132. RemoteEvent10.Parent = Sound9
  133. Sound11.Name = "Landing"
  134. Sound11.Parent = Part1
  135. Sound11.MaxDistance = 150
  136. Sound11.EmitterSize = 5
  137. Sound11.MinDistance = 5
  138. Sound11.SoundId = "rbxasset://sounds/action_jump_land.mp3"
  139. Sound11.Volume = 1
  140. RemoteEvent12.Name = "CharacterSoundEvent"
  141. RemoteEvent12.Parent = Sound11
  142. Sound13.Name = "Splash"
  143. Sound13.Parent = Part1
  144. Sound13.MaxDistance = 150
  145. Sound13.EmitterSize = 5
  146. Sound13.MinDistance = 5
  147. Sound13.SoundId = "rbxasset://sounds/impact_water.mp3"
  148. Sound13.Volume = 0.64999997615814
  149. RemoteEvent14.Name = "CharacterSoundEvent"
  150. RemoteEvent14.Parent = Sound13
  151. Sound15.Name = "Running"
  152. Sound15.Parent = Part1
  153. Sound15.Looped = true
  154. Sound15.MaxDistance = 150
  155. Sound15.EmitterSize = 5
  156. Sound15.MinDistance = 5
  157. Sound15.Pitch = 1.8500000238419
  158. Sound15.PlaybackSpeed = 1.8500000238419
  159. Sound15.SoundId = "rbxasset://sounds/action_footsteps_plastic.mp3"
  160. Sound15.Volume = 0.64999997615814
  161. RemoteEvent16.Name = "CharacterSoundEvent"
  162. RemoteEvent16.Parent = Sound15
  163. Sound17.Name = "Swimming"
  164. Sound17.Parent = Part1
  165. Sound17.Looped = true
  166. Sound17.MaxDistance = 150
  167. Sound17.EmitterSize = 5
  168. Sound17.MinDistance = 5
  169. Sound17.Pitch = 1.6000000238419
  170. Sound17.PlaybackSpeed = 1.6000000238419
  171. Sound17.SoundId = "rbxasset://sounds/action_swim.mp3"
  172. Sound17.Volume = 0.64999997615814
  173. RemoteEvent18.Name = "CharacterSoundEvent"
  174. RemoteEvent18.Parent = Sound17
  175. Sound19.Name = "Climbing"
  176. Sound19.Parent = Part1
  177. Sound19.Looped = true
  178. Sound19.MaxDistance = 150
  179. Sound19.EmitterSize = 5
  180. Sound19.MinDistance = 5
  181. Sound19.SoundId = "rbxasset://sounds/action_footsteps_plastic.mp3"
  182. Sound19.Volume = 0.64999997615814
  183. RemoteEvent20.Name = "CharacterSoundEvent"
  184. RemoteEvent20.Parent = Sound19
  185. Decal21.Name = "face"
  186. Decal21.Parent = Part1
  187. Decal21.Texture = "http://www.roblox.com/asset/?id=7074780"
  188. Sound22.Name = "The Prodigy - Voodoo People (Pendulum Remix)"
  189. Sound22.Parent = Part1
  190. Sound22.Looped = true
  191. Sound22.Playing = true
  192. Sound22.SoundId = "rbxassetid://775076753"
  193. Sound22.Volume = 0
  194. Sound23.Name = "footstep"
  195. Sound23.Parent = Part1
  196. Sound23.SoundId = "rbxassetid://131436155"
  197. Sound23.Volume = 8
  198. Weld24.Name = "HeadWeld"
  199. Weld24.Parent = Part1
  200. Weld24.C0 = CFrame.new(0, 0.5, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  201. Weld24.C1 = CFrame.new(0, 0.075000003, 0.0500000007, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  202. Weld24.Part0 = Part1
  203. Weld24.Part1 = Part49
  204. Weld24.part1 = Part49
  205. Weld25.Name = "HeadWeld"
  206. Weld25.Parent = Part1
  207. Weld25.C0 = CFrame.new(0, 0.5, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  208. Weld25.C1 = CFrame.new(0, 0.25999999, 0.150000006, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  209. Weld25.Part0 = Part1
  210. Weld25.Part1 = Part52
  211. Weld25.part1 = Part52
  212. Part26.Name = "Torso"
  213. Part26.Parent = Model0
  214. Part26.CFrame = CFrame.new(4.00040197, 34.8000336, -104.303101, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  215. Part26.Position = Vector3.new(4.00040197, 34.8000336, -104.303101)
  216. Part26.Color = Color3.new(0, 1, 0)
  217. Part26.Size = Vector3.new(2, 2, 1)
  218. Part26.BrickColor = BrickColor.new("Lime green")
  219. Part26.LeftParamA = 0
  220. Part26.LeftParamB = 0
  221. Part26.LeftSurface = Enum.SurfaceType.Weld
  222. Part26.RightParamA = 0
  223. Part26.RightParamB = 0
  224. Part26.RightSurface = Enum.SurfaceType.Weld
  225. Part26.brickColor = BrickColor.new("Lime green")
  226. Part26.FormFactor = Enum.FormFactor.Symmetric
  227. Part26.formFactor = Enum.FormFactor.Symmetric
  228. Decal27.Name = "roblox"
  229. Decal27.Parent = Part26
  230. Motor6D28.Name = "Left Shoulder"
  231. Motor6D28.Parent = Part26
  232. Motor6D28.MaxVelocity = 0.10000000149012
  233. Motor6D28.C0 = CFrame.new(-1, 0.5, 0, 0, 0, -1, 0, 1, 0, 1, 0, 0)
  234. Motor6D28.C1 = CFrame.new(0.5, 0.5, 0, 0, 0, -1, 0, 1, 0, 1, 0, 0)
  235. Motor6D28.Part0 = Part26
  236. Motor6D28.Part1 = Part33
  237. Motor6D28.part1 = Part33
  238. Motor6D29.Name = "Right Hip"
  239. Motor6D29.Parent = Part26
  240. Motor6D29.MaxVelocity = 0.10000000149012
  241. Motor6D29.C0 = CFrame.new(1, -1, 0, 0, 0, 1, 0, 1, -0, -1, 0, 0)
  242. Motor6D29.C1 = CFrame.new(0.5, 1, 0, 0, 0, 1, 0, 1, -0, -1, 0, 0)
  243. Motor6D29.Part0 = Part26
  244. Motor6D29.Part1 = Part36
  245. Motor6D29.part1 = Part36
  246. Motor6D30.Name = "Left Hip"
  247. Motor6D30.Parent = Part26
  248. Motor6D30.MaxVelocity = 0.10000000149012
  249. Motor6D30.C0 = CFrame.new(-1, -1, 0, 0, 0, -1, 0, 1, 0, 1, 0, 0)
  250. Motor6D30.C1 = CFrame.new(-0.5, 1, 0, 0, 0, -1, 0, 1, 0, 1, 0, 0)
  251. Motor6D30.Part0 = Part26
  252. Motor6D30.Part1 = Part35
  253. Motor6D30.part1 = Part35
  254. Motor6D31.Name = "Right Shoulder"
  255. Motor6D31.Parent = Part26
  256. Motor6D31.MaxVelocity = 0.10000000149012
  257. Motor6D31.C0 = CFrame.new(1, 0.5, 0, 0, 0, 1, 0, 1, -0, -1, 0, 0)
  258. Motor6D31.C1 = CFrame.new(-0.5, 0.5, 0, 0, 0, 1, 0, 1, -0, -1, 0, 0)
  259. Motor6D31.Part0 = Part26
  260. Motor6D31.Part1 = Part34
  261. Motor6D31.part1 = Part34
  262. Motor6D32.Name = "Neck"
  263. Motor6D32.Parent = Part26
  264. Motor6D32.MaxVelocity = 0.10000000149012
  265. Motor6D32.C0 = CFrame.new(0, 1, 0, -1, 0, 0, 0, 0, 1, 0, 1, -0)
  266. Motor6D32.C1 = CFrame.new(0, -0.5, 0, -1, 0, 0, 0, 0, 1, 0, 1, -0)
  267. Motor6D32.Part0 = Part26
  268. Motor6D32.Part1 = Part1
  269. Motor6D32.part1 = Part1
  270. Part33.Name = "Left Arm"
  271. Part33.Parent = Model0
  272. Part33.CFrame = CFrame.new(2.50040197, 34.8000336, -104.303101, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  273. Part33.Position = Vector3.new(2.50040197, 34.8000336, -104.303101)
  274. Part33.Color = Color3.new(1, 0.8, 0.6)
  275. Part33.Size = Vector3.new(1, 2, 1)
  276. Part33.BrickColor = BrickColor.new("Pastel brown")
  277. Part33.CanCollide = false
  278. Part33.brickColor = BrickColor.new("Pastel brown")
  279. Part33.FormFactor = Enum.FormFactor.Symmetric
  280. Part33.formFactor = Enum.FormFactor.Symmetric
  281. Part34.Name = "Right Arm"
  282. Part34.Parent = Model0
  283. Part34.CFrame = CFrame.new(5.50040197, 34.8000336, -104.303101, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  284. Part34.Position = Vector3.new(5.50040197, 34.8000336, -104.303101)
  285. Part34.Color = Color3.new(1, 0.8, 0.6)
  286. Part34.Size = Vector3.new(1, 2, 1)
  287. Part34.BrickColor = BrickColor.new("Pastel brown")
  288. Part34.CanCollide = false
  289. Part34.brickColor = BrickColor.new("Pastel brown")
  290. Part34.FormFactor = Enum.FormFactor.Symmetric
  291. Part34.formFactor = Enum.FormFactor.Symmetric
  292. Part35.Name = "Left Leg"
  293. Part35.Parent = Model0
  294. Part35.CFrame = CFrame.new(3.50040197, 32.8000336, -104.303101, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  295. Part35.Position = Vector3.new(3.50040197, 32.8000336, -104.303101)
  296. Part35.Color = Color3.new(0.0666667, 0.0666667, 0.0666667)
  297. Part35.Size = Vector3.new(1, 2, 1)
  298. Part35.BottomSurface = Enum.SurfaceType.Smooth
  299. Part35.BrickColor = BrickColor.new("Really black")
  300. Part35.CanCollide = false
  301. Part35.brickColor = BrickColor.new("Really black")
  302. Part35.FormFactor = Enum.FormFactor.Symmetric
  303. Part35.formFactor = Enum.FormFactor.Symmetric
  304. Part36.Name = "Right Leg"
  305. Part36.Parent = Model0
  306. Part36.CFrame = CFrame.new(4.50040197, 32.8000336, -104.303101, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  307. Part36.Position = Vector3.new(4.50040197, 32.8000336, -104.303101)
  308. Part36.Color = Color3.new(0.0666667, 0.0666667, 0.0666667)
  309. Part36.Size = Vector3.new(1, 2, 1)
  310. Part36.BottomSurface = Enum.SurfaceType.Smooth
  311. Part36.BrickColor = BrickColor.new("Really black")
  312. Part36.CanCollide = false
  313. Part36.brickColor = BrickColor.new("Really black")
  314. Part36.FormFactor = Enum.FormFactor.Symmetric
  315. Part36.formFactor = Enum.FormFactor.Symmetric
  316. Humanoid37.Parent = Model0
  317. Humanoid37.LeftLeg = Part35
  318. Humanoid37.RightLeg = Part36
  319. Humanoid37.Torso = Part38
  320. Part38.Name = "HumanoidRootPart"
  321. Part38.Parent = Model0
  322. Part38.CFrame = CFrame.new(4.00040197, 34.8000336, -104.303101, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  323. Part38.Position = Vector3.new(4.00040197, 34.8000336, -104.303101)
  324. Part38.Transparency = 1
  325. Part38.Size = Vector3.new(2, 2, 1)
  326. Part38.BottomSurface = Enum.SurfaceType.Smooth
  327. Part38.CanCollide = false
  328. Part38.LeftParamA = 0
  329. Part38.LeftParamB = 0
  330. Part38.RightParamA = 0
  331. Part38.RightParamB = 0
  332. Part38.TopSurface = Enum.SurfaceType.Smooth
  333. Part38.FormFactor = Enum.FormFactor.Symmetric
  334. Part38.formFactor = Enum.FormFactor.Symmetric
  335. Motor6D39.Name = "RootJoint"
  336. Motor6D39.Parent = Part38
  337. Motor6D39.MaxVelocity = 0.10000000149012
  338. Motor6D39.C0 = CFrame.new(0, 0, 0, -1, 0, 0, 0, 0, 1, 0, 1, -0)
  339. Motor6D39.C1 = CFrame.new(0, 0, 0, -1, 0, 0, 0, 0, 1, 0, 1, -0)
  340. Motor6D39.Part0 = Part38
  341. Motor6D39.Part1 = Part26
  342. Motor6D39.part1 = Part26
  343. Script40.Name = "Health"
  344. Script40.Parent = Model0
  345. table.insert(cors,sandbox(Script40,function()
  346. -- Gradually regenerates the Humanoid's Health over time.
  347.  
  348. local REGEN_RATE = 1/100 -- Regenerate this fraction of MaxHealth per second.
  349. local REGEN_STEP = 1 -- Wait this long between each regeneration step.
  350.  
  351. --------------------------------------------------------------------------------
  352.  
  353. local Character = script.Parent
  354. local Humanoid = Character:WaitForChild'Humanoid'
  355.  
  356. --------------------------------------------------------------------------------
  357.  
  358. while true do
  359.     while Humanoid.Health < Humanoid.MaxHealth do
  360.         local dt = wait(REGEN_STEP)
  361.         local dh = dt*REGEN_RATE*Humanoid.MaxHealth
  362.         Humanoid.Health = math.min(Humanoid.Health + dh, Humanoid.MaxHealth)
  363.     end
  364.     Humanoid.HealthChanged:Wait()
  365. end
  366. end))
  367. BodyColors41.Parent = Model0
  368. BodyColors41.HeadColor = BrickColor.new("Pastel brown")
  369. BodyColors41.HeadColor3 = Color3.new(1, 0.8, 0.6)
  370. BodyColors41.LeftArmColor = BrickColor.new("Pastel brown")
  371. BodyColors41.LeftArmColor3 = Color3.new(1, 0.8, 0.6)
  372. BodyColors41.LeftLegColor = BrickColor.new("Really black")
  373. BodyColors41.LeftLegColor3 = Color3.new(0.0666667, 0.0666667, 0.0666667)
  374. BodyColors41.RightArmColor = BrickColor.new("Pastel brown")
  375. BodyColors41.RightArmColor3 = Color3.new(1, 0.8, 0.6)
  376. BodyColors41.RightLegColor = BrickColor.new("Really black")
  377. BodyColors41.RightLegColor3 = Color3.new(0.0666667, 0.0666667, 0.0666667)
  378. BodyColors41.TorsoColor = BrickColor.new("Lime green")
  379. BodyColors41.TorsoColor3 = Color3.new(0, 1, 0)
  380. Accessory42.Name = "Bandana"
  381. Accessory42.Parent = Model0
  382. Accessory42.AttachmentPoint = CFrame.new(0, 0.800000012, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  383. Accessory42.AttachmentPos = Vector3.new(0, 0.800000012, 0)
  384. Part43.Name = "Handle"
  385. Part43.Parent = Accessory42
  386. Part43.CFrame = CFrame.new(4.00040197, 36.0000343, -104.302826, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  387. Part43.Position = Vector3.new(4.00040197, 36.0000343, -104.302826)
  388. Part43.Color = Color3.new(0.0666667, 0.0666667, 0.0666667)
  389. Part43.Size = Vector3.new(1, 1, 1)
  390. Part43.BottomSurface = Enum.SurfaceType.Smooth
  391. Part43.BrickColor = BrickColor.new("Really black")
  392. Part43.CanCollide = false
  393. Part43.TopSurface = Enum.SurfaceType.Smooth
  394. Part43.brickColor = BrickColor.new("Really black")
  395. Part43.FormFactor = Enum.FormFactor.Symmetric
  396. Part43.formFactor = Enum.FormFactor.Symmetric
  397. SpecialMesh44.Parent = Part43
  398. SpecialMesh44.MeshId = "http://www.roblox.com/asset/?id=20637493"
  399. SpecialMesh44.Scale = Vector3.new(1, 0.899999976, 1)
  400. SpecialMesh44.VertexColor = Vector3.new(0, 0, 0)
  401. SpecialMesh44.TextureId = "http://www.roblox.com/asset/?id=143631818 "
  402. SpecialMesh44.MeshType = Enum.MeshType.FileMesh
  403. Vector3Value45.Name = "OriginalSize"
  404. Vector3Value45.Parent = Part43
  405. Vector3Value45.Value = Vector3.new(1, 1, 1)
  406. Weld46.Name = "AccessoryWeld"
  407. Weld46.Parent = Part43
  408. Weld46.C0 = CFrame.new(3.93629307e-09, 0.300000191, -0.600272298, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  409. Weld46.C1 = CFrame.new(0, 0, -0.600000024, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  410. Weld46.Part0 = Part43
  411. Weld46.Part1 = Part1
  412. Weld46.part1 = Part1
  413. Accessory47.Name = "YellowROBLOXVisor"
  414. Accessory47.Parent = Model0
  415. Accessory47.AttachmentPoint = CFrame.new(0, 0.0900000036, 0.180000007, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  416. Accessory47.AttachmentPos = Vector3.new(0, 0.0900000036, 0.180000007)
  417. Hat48.Name = "Black Charmer"
  418. Hat48.Parent = Model0
  419. Hat48.AttachmentPoint = CFrame.new(0, 0.075000003, 0.0500000007, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  420. Hat48.AttachmentPos = Vector3.new(0, 0.075000003, 0.0500000007)
  421. Part49.Name = "Handle"
  422. Part49.Parent = Hat48
  423. Part49.CFrame = CFrame.new(4.00040197, 36.7250328, -104.353104, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  424. Part49.Position = Vector3.new(4.00040197, 36.7250328, -104.353104)
  425. Part49.Size = Vector3.new(1.19999957, 1, 1.5999999)
  426. Part49.BottomSurface = Enum.SurfaceType.Smooth
  427. Part49.CanCollide = false
  428. Part49.TopSurface = Enum.SurfaceType.Smooth
  429. Part49.FormFactor = Enum.FormFactor.Custom
  430. Part49.formFactor = Enum.FormFactor.Custom
  431. SpecialMesh50.Parent = Part49
  432. SpecialMesh50.MeshId = "http://www.roblox.com/asset/?id=74878559"
  433. SpecialMesh50.Scale = Vector3.new(1.04999995, 1, 1.04999995)
  434. SpecialMesh50.TextureId = "http://www.roblox.com/asset/?id=21557995"
  435. SpecialMesh50.MeshType = Enum.MeshType.FileMesh
  436. Hat51.Name = "ClockworksShades"
  437. Hat51.Parent = Model0
  438. Hat51.AttachmentPoint = CFrame.new(0, 0.25999999, 0.150000006, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  439. Hat51.AttachmentPos = Vector3.new(0, 0.25999999, 0.150000006)
  440. Part52.Name = "Handle"
  441. Part52.Parent = Hat51
  442. Part52.CFrame = CFrame.new(4.00040197, 36.5400352, -104.453102, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  443. Part52.Position = Vector3.new(4.00040197, 36.5400352, -104.453102)
  444. Part52.Size = Vector3.new(1, 1.60000002, 1)
  445. Part52.BottomSurface = Enum.SurfaceType.Smooth
  446. Part52.CanCollide = false
  447. Part52.Material = Enum.Material.DiamondPlate
  448. Part52.TopSurface = Enum.SurfaceType.Smooth
  449. Part52.FormFactor = Enum.FormFactor.Plate
  450. Part52.formFactor = Enum.FormFactor.Plate
  451. SpecialMesh53.Parent = Part52
  452. SpecialMesh53.MeshId = "http://www.roblox.com/asset/?id=1577360"
  453. SpecialMesh53.Scale = Vector3.new(1, 1.29999995, 1)
  454. SpecialMesh53.VertexColor = Vector3.new(0, 0, 0)
  455. SpecialMesh53.TextureId = "http://www.roblox.com/asset/?id=175673588"
  456. SpecialMesh53.MeshType = Enum.MeshType.FileMesh
  457. Shirt54.Name = "Shirt"
  458. Shirt54.Parent = Model0
  459. Shirt54.ShirtTemplate = "rbxassetid://463141967"
  460. Pants55.Name = "Pants"
  461. Pants55.Parent = Model0
  462. Pants55.PantsTemplate = "rbxassetid://175974404"
  463. Part56.Name = "AK-47"
  464. Part56.Parent = Model0
  465. Part56.CFrame = CFrame.new(6.30040455, 32.800045, -107.403091, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  466. Part56.Position = Vector3.new(6.30040455, 32.800045, -107.403091)
  467. Part56.Size = Vector3.new(1, 2, 6)
  468. Part56.BottomSurface = Enum.SurfaceType.Smooth
  469. Part56.CanCollide = false
  470. Part56.TopSurface = Enum.SurfaceType.Smooth
  471. SpecialMesh57.Parent = Part56
  472. SpecialMesh57.MeshId = "rbxassetid://477006495"
  473. SpecialMesh57.Scale = Vector3.new(0.0399999991, 0.0399999991, 0.0399999991)
  474. SpecialMesh57.TextureId = "rbxassetid://477006525"
  475. SpecialMesh57.MeshType = Enum.MeshType.FileMesh
  476. Sound58.Name = "shoot"
  477. Sound58.Parent = Part56
  478. Sound58.SoundId = "rbxassetid://139711658"
  479. Sound58.Volume = 2
  480. Script59.Name = "NPC AI"
  481. Script59.Parent = Model0
  482. table.insert(cors,sandbox(Script59,function()
  483. --Fully made by Rufus14
  484. --animations are made with :lerp()
  485. --you can convert the model to use it in script builder
  486. local npc = script.Parent
  487. local torso = npc.Torso
  488. local head = npc.Head
  489. local leftarm = npc["Left Arm"]
  490. local rightarm = npc["Right Arm"]
  491. local leftleg = npc["Left Leg"]
  492. local rightleg = npc["Right Leg"]
  493. local npchumanoid = npc.Humanoid
  494. local aksound = npc["AK-47"].shoot
  495. --Motor6D's
  496. local neck = torso.Neck
  497. neck.C1 = CFrame.new(0,0,0)
  498. local leftshoulder = torso["Left Shoulder"]
  499. leftshoulder.C1 = CFrame.new(0,0,0)
  500. local rightshoulder = torso["Right Shoulder"]
  501. rightshoulder.C1 = CFrame.new(0,0,0)
  502. local lefthip = torso["Left Hip"]
  503. lefthip.C1 = CFrame.new(0,0,0)
  504. local righthip = torso["Right Hip"]
  505. righthip.C1 = CFrame.new(0,0,0)
  506. local root = npc.HumanoidRootPart.RootJoint
  507. root.C1 = CFrame.new(0,0,0)
  508. --
  509. local sight = 120
  510. local walking = false
  511. local shooting = false
  512. local canshoot = true
  513. local cansay = true
  514. local saycooldown = 0
  515. local akweld = Instance.new("Weld", npc["AK-47"])
  516. akweld.Part0 = rightarm
  517. akweld.Part1 = npc["AK-47"]
  518. function walkanim(walkspeed)
  519.     if walkspeed > 15 then
  520.         walking = true
  521.     else
  522.         walking = false
  523.     end
  524. end
  525. npchumanoid.Running:connect(walkanim)
  526. function randomwalk()
  527.     while wait(math.random(3,6)) do
  528.         if not shooting and not walking then
  529.             npchumanoid.WalkSpeed = 16
  530.             local function createwalkpart()
  531.                 local walkpart = Instance.new("Part", npc)
  532.                 walkpart.Size = Vector3.new(1,1,1)
  533.                 walkpart.Anchored = true
  534.                 walkpart.Material = "Neon"
  535.                 walkpart.Transparency = 1
  536.                 walkpart.BrickColor = BrickColor.new("Maroon")
  537.                 walkpart.CFrame = torso.CFrame * CFrame.new(math.random(-60,60),math.random(-30,30),math.random(-60,60))
  538.                 local path = game:GetService("PathfindingService"):FindPathAsync(torso.Position, walkpart.Position)
  539.                 local waypoints = path:GetWaypoints()
  540.                 if path.Status == Enum.PathStatus.Success then
  541.                     for i,v in pairs(waypoints) do
  542.                         local pospart = Instance.new("Part", npc)
  543.                         pospart.Size = Vector3.new(1,1,1)
  544.                         pospart.Anchored = true
  545.                         pospart.Material = "Neon"
  546.                         pospart.Transparency = 1
  547.                         pospart.Position = v.Position
  548.                         pospart.Name = "pospart"
  549.                         pospart.CanCollide = false
  550.                     end
  551.                     for i,v in pairs(waypoints) do
  552.                         npchumanoid:MoveTo(v.Position)
  553.                         local allow = 0
  554.                         while (torso.Position - v.Position).magnitude > 4.5 and allow < 35 do
  555.                             allow = allow + 1
  556.                             wait()
  557.                         end
  558.                         if v.Action == Enum.PathWaypointAction.Jump then
  559.                             npchumanoid.Jump = true
  560.                         end
  561.                     end
  562.                     for i,v in pairs(npc:GetChildren()) do
  563.                         if v.Name == "pospart" then
  564.                             v:destroy()
  565.                         end
  566.                     end
  567.                 else
  568.                     createwalkpart()
  569.                     wait()
  570.                 end
  571.                 walkpart:destroy()
  572.             end
  573.             createwalkpart()
  574.         end
  575.     end
  576. end
  577. function checkandshoot()
  578.     while wait() do
  579.         saycooldown = saycooldown + 1
  580.         if saycooldown == 500 then
  581.             cansay = true
  582.             saycooldown = 0
  583.         end
  584.         for i,v in pairs(workspace:GetChildren()) do
  585.             if v.ClassName == "Model" and v.Name ~= "Rufus14" then
  586.                 local victimhumanoid = v:findFirstChildOfClass("Humanoid")
  587.                 local victimhead = v:findFirstChild("Head")
  588.                 if victimhumanoid and victimhead and v.Name ~= npc.Name then
  589.                     if (victimhead.Position - head.Position).magnitude < sight then
  590.                         if victimhumanoid.Name == "noneofurbusiness" and cansay then
  591.                            
  592.                         elseif not shooting and victimhumanoid.Health > 0 and canshoot then
  593.                             shooting = true
  594.                             walking = false
  595.                             local doesshoot = 0
  596.                             local hpnow = npchumanoid.Health
  597.                             local walk = 0
  598.                             npchumanoid.WalkSpeed = 0
  599.                             while shooting and (victimhead.Position - head.Position).magnitude < sight and victimhumanoid.Health > 0 and canshoot do
  600.                                 doesshoot = doesshoot + 1
  601.                                 walk = walk + 1
  602.                                 if npchumanoid.PlatformStand == false then
  603.                                     npc.HumanoidRootPart.CFrame = CFrame.new(npc.HumanoidRootPart.Position,Vector3.new(victimhead.Position.x,npc.HumanoidRootPart.Position.y,victimhead.Position.z))
  604.                                 end
  605.                                 if walk == 100 and not walking then
  606.                                     local function createwalkpart()
  607.                                         local walkpart = Instance.new("Part", npc)
  608.                                         walkpart.Size = Vector3.new(1,1,1)
  609.                                         walkpart.Anchored = true
  610.                                         walkpart.Material = "Neon"
  611.                                         walkpart.Transparency = 1
  612.                                         walkpart.BrickColor = BrickColor.new("Maroon")
  613.                                         walkpart.CFrame = torso.CFrame * CFrame.new(-math.random(20,60),math.random(-40,40),math.random(-10,10))
  614.                                         local path = game:GetService("PathfindingService"):FindPathAsync(torso.Position, walkpart.Position)
  615.                                         local waypoints = path:GetWaypoints()
  616.                                         if path.Status == Enum.PathStatus.Success then
  617.                                             shooting = false
  618.                                             canshoot = false
  619.                                             npchumanoid.WalkSpeed = 20
  620.                                             for i,v in pairs(waypoints) do
  621.                                                 local pospart = Instance.new("Part", npc)
  622.                                                 pospart.Size = Vector3.new(1,1,1)
  623.                                                 pospart.Anchored = true
  624.                                                 pospart.Material = "Neon"
  625.                                                 pospart.Transparency = 1
  626.                                                 pospart.Position = v.Position
  627.                                                 pospart.Name = "pospart"
  628.                                                 pospart.CanCollide = false
  629.                                             end
  630.                                             for i,v in pairs(waypoints) do
  631.                                                 npchumanoid:MoveTo(v.Position)
  632.                                                 local allow = 0
  633.                                                 while (torso.Position - v.Position).magnitude > 4.5 and allow < 35 do
  634.                                                     allow = allow + 1
  635.                                                     wait()
  636.                                                 end
  637.                                                 if v.Action == Enum.PathWaypointAction.Jump then
  638.                                                     npchumanoid.Jump = true
  639.                                                 end
  640.                                             end
  641.                                             canshoot = true
  642.                                             npchumanoid.WalkSpeed = 16
  643.                                             for i,v in pairs(npc:GetChildren()) do
  644.                                                 if v.Name == "pospart" then
  645.                                                     v:destroy()
  646.                                                 end
  647.                                             end
  648.                                         else
  649.                                             createwalkpart()
  650.                                             wait()
  651.                                         end
  652.                                         walkpart:destroy()
  653.                                     end
  654.                                     createwalkpart()
  655.                                 end
  656.                                 if doesshoot == 5 then
  657.                                     doesshoot = 0
  658.                                     npc["AK-47"].shoot:Play()
  659.                                     local bullet = Instance.new("Part", npc)
  660.                                     bullet.Size = Vector3.new(0.3,0.3,3.5)
  661.                                     bullet.Material = "Neon"
  662.                                     bullet.CFrame = npc["AK-47"].CFrame * CFrame.new(0,0,-4)
  663.                                     bullet.CanCollide = false
  664.                                     local velocity = Instance.new("BodyVelocity", bullet)
  665.                                     velocity.MaxForce = Vector3.new(math.huge,math.huge,math.huge)
  666.                                     bullet.CFrame = CFrame.new(bullet.Position, victimhead.Position)
  667.                                     velocity.Velocity = bullet.CFrame.lookVector * 500 + Vector3.new(math.random(-25,25),math.random(-25,25),0)
  668.                                     local function damage(part)
  669.                                         local damage = math.random(10,25)
  670.                                         if part.Parent.ClassName ~= "Accessory" and part.Parent.Parent.ClassName ~= "Accessory" and part.ClassName ~= "Accessory" and part.Parent.Name ~= npc.Name then
  671.                                             bullet:destroy()
  672.                                             local victimhumanoid = part.Parent:findFirstChildOfClass("Humanoid")
  673.                                             if victimhumanoid then
  674.                                                 if victimhumanoid.Health > damage then
  675.                                                     victimhumanoid:TakeDamage(damage)
  676.                                                 else
  677.                                                     victimhumanoid:TakeDamage(damage)
  678.                                                 end
  679.                                             end
  680.                                         end
  681.                                     end
  682.                                     game.Debris:AddItem(bullet, 5)
  683.                                     bullet.Touched:connect(damage)
  684.                                 end
  685.                                 wait()
  686.                             end
  687.                             walking = false
  688.                             shooting = false
  689.                         end
  690.                     end
  691.                 end
  692.             end
  693.         end
  694.     end
  695. end
  696. function run()
  697.     while wait() do
  698.         local hpnow = npchumanoid.Health
  699.         wait()
  700.         if npchumanoid.Health < hpnow then
  701.             local dorun = math.random(1,1)
  702.             if dorun == 1 and not walking then
  703.                 local function createwalkpart()
  704.                     local walkpart = Instance.new("Part", npc)
  705.                     walkpart.Size = Vector3.new(1,1,1)
  706.                     walkpart.Anchored = true
  707.                     walkpart.Material = "Neon"
  708.                     walkpart.Transparency = 1
  709.                     walkpart.BrickColor = BrickColor.new("Maroon")
  710.                     walkpart.CFrame = torso.CFrame * CFrame.new(math.random(20,60),math.random(-20,20),math.random(-60,60))
  711.                     local path = game:GetService("PathfindingService"):FindPathAsync(torso.Position, walkpart.Position)
  712.                     local waypoints = path:GetWaypoints()
  713.                     if path.Status == Enum.PathStatus.Success then
  714.                         shooting = false
  715.                         canshoot = false
  716.                         walking = true
  717.                         npchumanoid.WalkSpeed = 20
  718.                         for i,v in pairs(waypoints) do
  719.                             local pospart = Instance.new("Part", npc)
  720.                             pospart.Size = Vector3.new(1,1,1)
  721.                             pospart.Anchored = true
  722.                             pospart.Material = "Neon"
  723.                             pospart.Transparency = 1
  724.                             pospart.Position = v.Position
  725.                             pospart.Name = "pospart"
  726.                             pospart.CanCollide = false
  727.                         end
  728.                         for i,v in pairs(waypoints) do
  729.                             npchumanoid:MoveTo(v.Position)
  730.                             local allow = 0
  731.                             while (torso.Position - v.Position).magnitude > 4.5 and allow < 35 do
  732.                                 allow = allow + 1
  733.                                 wait()
  734.                             end
  735.                             if v.Action == Enum.PathWaypointAction.Jump then
  736.                                 npchumanoid.Jump = true
  737.                             end
  738.                         end
  739.                         shooting = false
  740.                         canshoot = true
  741.                         walking = false
  742.                         npchumanoid.WalkSpeed = 16
  743.                         for i,v in pairs(npc:GetChildren()) do
  744.                             if v.Name == "pospart" then
  745.                                 v:destroy()
  746.                             end
  747.                         end
  748.                     else
  749.                         createwalkpart()
  750.                         wait()
  751.                     end
  752.                     walkpart:destroy()
  753.                 end
  754.                 createwalkpart()
  755.             end
  756.         end
  757.     end
  758. end
  759. function death()
  760.     if head:findFirstChild("The Prodigy - Voodoo People (Pendulum Remix)") then
  761.         head["The Prodigy - Voodoo People (Pendulum Remix)"]:destroy()
  762.     end
  763.     npchumanoid.Archivable = true
  764.                                         local zombiecorpse = npchumanoid.Parent:Clone()
  765.                                         npchumanoid.Parent:destroy()
  766.                                         zombiecorpse.Parent = workspace
  767.                                         game.Debris:AddItem(zombiecorpse, 15)
  768.                                         local Humanoid = zombiecorpse:findFirstChildOfClass("Humanoid")
  769.                                         local Torso = zombiecorpse.Torso
  770.                                         Humanoid.PlatformStand = true
  771.                                         Humanoid:SetStateEnabled("Dead", false)
  772.                                         for i,v in pairs(Humanoid.Parent.Torso:GetChildren()) do
  773.                                             if v.ClassName == 'Motor6D' or v.ClassName == 'Weld' then
  774.                                                 v:destroy()
  775.                                             end
  776.                                         end
  777.                                         for i,v in pairs(zombiecorpse:GetChildren()) do
  778.                                             if v.ClassName == "Part" then
  779.                                                 for q,w in pairs(v:GetChildren()) do
  780.                                                     if w.ClassName == "BodyPosition" or w.ClassName == "BodyVelocity" then
  781.                                                         w:destroy()
  782.                                                     end
  783.                                                 end
  784.                                             end
  785.                                         end
  786.                                         local function makeconnections(limb, attachementone, attachmenttwo, twistlower, twistupper, upperangle)
  787.                                             local connection = Instance.new('BallSocketConstraint', limb)
  788.                                             connection.LimitsEnabled = true
  789.                                             connection.Attachment0 = attachementone
  790.                                             connection.Attachment1 = attachmenttwo
  791.                                             connection.TwistLimitsEnabled = true
  792.                                             connection.TwistLowerAngle = twistlower
  793.                                             connection.TwistUpperAngle = twistupper
  794.                                             connection.UpperAngle = 70
  795.                                         end
  796.                                         local function makehingeconnections(limb, attachementone, attachmenttwo, twistlower, twistupper, upperangle)
  797.                                             local connection = Instance.new('HingeConstraint', limb)
  798.                                             connection.Attachment0 = attachementone
  799.                                             connection.Attachment1 = attachmenttwo
  800.                                             connection.LimitsEnabled = true
  801.                                             connection.LowerAngle = twistlower
  802.                                             connection.UpperAngle = twistupper
  803.                                         end
  804.                                         Humanoid.Parent['Right Arm'].RightShoulderAttachment.Position = Vector3.new(0, 0.5, 0)
  805.                                         Torso.RightCollarAttachment.Position = Vector3.new(1.5, 0.5, 0)
  806.                                         Humanoid.Parent['Left Arm'].LeftShoulderAttachment.Position = Vector3.new(0, 0.5, 0)
  807.                                         Torso.LeftCollarAttachment.Position = Vector3.new(-1.5, 0.5, 0)
  808.                                         local RightLegAttachment = Instance.new("Attachment", Humanoid.Parent["Right Leg"])
  809.                                         RightLegAttachment.Position = Vector3.new(0, 1, 0)
  810.                                         local TorsoRightLegAttachment = Instance.new("Attachment", Torso)
  811.                                         TorsoRightLegAttachment.Position = Vector3.new(0.5, -1, 0)
  812.                                         --
  813.                                         local LeftLegAttachment = Instance.new("Attachment", Humanoid.Parent["Left Leg"])
  814.                                         LeftLegAttachment.Position = Vector3.new(0, 1, 0)
  815.                                         local TorsoLeftLegAttachment = Instance.new("Attachment", Torso)
  816.                                         TorsoLeftLegAttachment.Position = Vector3.new(-0.5, -1, 0)
  817.                                         --
  818.                                         if Humanoid.Parent:findFirstChild("Head") then
  819.                                             local HeadAttachment = Instance.new("Attachment", Humanoid.Parent.Head)
  820.                                             HeadAttachment.Position = Vector3.new(0, -0.5, 0)
  821.                                             makehingeconnections(Humanoid.Parent.Head, HeadAttachment, Torso.NeckAttachment, -20, 20, 70)
  822.                                         end
  823.                                         makeconnections(Humanoid.Parent['Right Arm'], Humanoid.Parent['Right Arm'].RightShoulderAttachment, Torso.RightCollarAttachment, -80, 80)
  824.                                         makeconnections(Humanoid.Parent['Left Arm'], Humanoid.Parent['Left Arm'].LeftShoulderAttachment, Torso.LeftCollarAttachment, -80, 80)
  825.                                         makeconnections(Humanoid.Parent['Right Leg'], RightLegAttachment, TorsoRightLegAttachment, -80, 80, 70)
  826.                                         makeconnections(Humanoid.Parent['Left Leg'], LeftLegAttachment, TorsoLeftLegAttachment, -80, 80, 70)
  827.                                         if Humanoid.Parent:findFirstChild("Right Arm") then
  828.                                             local limbcollider = Instance.new("Part", Humanoid.Parent["Right Arm"])
  829.                                             limbcollider.Size = Vector3.new(1,1.3,1)
  830.                                             limbcollider.Shape = "Cylinder"
  831.                                             limbcollider.Transparency = 1
  832.                                             local limbcolliderweld = Instance.new("Weld", limbcollider)
  833.                                             limbcolliderweld.Part0 = Humanoid.Parent["Right Arm"]
  834.                                             limbcolliderweld.Part1 = limbcollider
  835.                                             limbcolliderweld.C0 = CFrame.fromEulerAnglesXYZ(0,0,math.pi/2) * CFrame.new(-0.4,0,0)
  836.                                             for i,v in pairs(zombiecorpse["Right Arm"]:GetChildren()) do
  837.                                                 if v.ClassName == 'Motor6D' or v.ClassName == 'Weld' then
  838.                                                     v:destroy()
  839.                                                 end
  840.                                             end
  841.                                         end
  842.                                         --
  843.                                         if Humanoid.Parent:findFirstChild("Left Arm") then
  844.                                             local limbcollider = Instance.new("Part", Humanoid.Parent["Left Arm"])
  845.                                             limbcollider.Size = Vector3.new(1,1.3,1)
  846.                                             limbcollider.Shape = "Cylinder"
  847.                                             limbcollider.Transparency = 1
  848.                                             local limbcolliderweld = Instance.new("Weld", limbcollider)
  849.                                             limbcolliderweld.Part0 = Humanoid.Parent["Left Arm"]
  850.                                             limbcolliderweld.Part1 = limbcollider
  851.                                             limbcolliderweld.C0 = CFrame.fromEulerAnglesXYZ(0,0,math.pi/2) * CFrame.new(-0.4,0,0)
  852.                                         end
  853.                                         --
  854.                                         if Humanoid.Parent:findFirstChild("Left Leg") then
  855.                                             local limbcollider = Instance.new("Part", Humanoid.Parent["Left Leg"])
  856.                                             limbcollider.Size = Vector3.new(1,1.3,1)
  857.                                             limbcollider.Shape = "Cylinder"
  858.                                             limbcollider.Transparency = 1
  859.                                             local limbcolliderweld = Instance.new("Weld", limbcollider)
  860.                                             limbcolliderweld.Part0 = Humanoid.Parent["Left Leg"]
  861.                                             limbcolliderweld.Part1 = limbcollider
  862.                                             limbcolliderweld.C0 = CFrame.fromEulerAnglesXYZ(0,0,math.pi/2) * CFrame.new(-0.4,0,0)
  863.                                         end
  864.                                         --
  865.                                         if Humanoid.Parent:findFirstChild("Right Leg") then
  866.                                             local limbcollider = Instance.new("Part", Humanoid.Parent["Right Leg"])
  867.                                             limbcollider.Size = Vector3.new(1,1.3,1)
  868.                                             limbcollider.Shape = "Cylinder"
  869.                                             limbcollider.Transparency = 1
  870.                                             local limbcolliderweld = Instance.new("Weld", limbcollider)
  871.                                             limbcolliderweld.Part0 = Humanoid.Parent["Right Leg"]
  872.                                             limbcolliderweld.Part1 = limbcollider
  873.                                             limbcolliderweld.C0 = CFrame.fromEulerAnglesXYZ(0,0,math.pi/2) * CFrame.new(-0.4,0,0)
  874.                                         end
  875.                                         local ragdoll = zombiecorpse
  876.                                         if ragdoll:findFirstChild("HumanoidRootPart") then
  877.                                             ragdoll.HumanoidRootPart.CanCollide = false
  878.                                             ragdoll.HumanoidRootPart:destroy()
  879.                                         end
  880. end
  881. npchumanoid.Died:connect(death)
  882. spawn(run)
  883. spawn(checkandshoot)
  884. spawn(randomwalk)
  885. while wait() do --check animations and other things
  886.     if not walking and not shooting then
  887.         for i = 0.2,0.8 , 0.09 do
  888.             if not walking and not shooting then
  889.                 akweld.C0 = akweld.C0:lerp(CFrame.new(-0.583096504, -1.87343168, 0.0918724537, 0.808914721, -0.582031429, 0.0830438882, -0.166903317, -0.0918986499, 0.981681228, -0.56373775, -0.807956576, -0.171481162),i)
  890.                 rightshoulder.C0 = rightshoulder.C0:lerp(CFrame.new(1.32261992, 0.220639229, -0.279059082, 0.766044497, 0.604022682, -0.219846413, -0.492403805, 0.331587851, -0.804728508, -0.413175881, 0.724711061, 0.551434159),i)
  891.                 leftshoulder.C0 = leftshoulder.C0:lerp(CFrame.new(-1.16202736, -0.00836706161, -0.880517244, 0.939692557, -0.342020094, -2.98023224e-08, 0.171009958, 0.46984598, -0.866025567, 0.296198159, 0.813797832, 0.499999642),i)
  892.                 lefthip.C0 = lefthip.C0:lerp(CFrame.new(-0.599619389, -1.99128425, 0, 0.996194661, 0.087155968, 0, -0.087155968, 0.996194661, 0, 0, 0, 1),i)
  893.                 righthip.C0 = righthip.C0:lerp(CFrame.new(0.599619389, -1.99128449, 0, 0.996194661, -0.087155968, 0, 0.087155968, 0.996194661, 0, 0, 0, 1),i)
  894.                 root.C0 = root.C0:lerp(CFrame.new(0,0,0),i)
  895.                 neck.C0 = neck.C0:lerp(CFrame.new(0,1.5,0),i)
  896.                 wait()
  897.             end
  898.         end
  899.     end
  900.     if walking then --this is the walking animation
  901.         for i = 0.2,0.8 , 0.09 do
  902.             if walking then
  903.                 akweld.C0 = akweld.C0:lerp(CFrame.new(-0.583096504, -1.87343168, 0.0918724537, 0.808914721, -0.582031429, 0.0830438882, -0.166903317, -0.0918986499, 0.981681228, -0.56373775, -0.807956576, -0.171481162),i)
  904.                 rightshoulder.C0 = rightshoulder.C0:lerp(CFrame.new(1.32261992, 0.220639229, -0.279059082, 0.766044497, 0.604022682, -0.219846413, -0.492403805, 0.331587851, -0.804728508, -0.413175881, 0.724711061, 0.551434159),i)
  905.                 leftshoulder.C0 = leftshoulder.C0:lerp(CFrame.new(-1.16202736, -0.00836706161, -0.880517244, 0.939692557, -0.342020094, -2.98023224e-08, 0.171009958, 0.46984598, -0.866025567, 0.296198159, 0.813797832, 0.499999642),i)
  906.                 lefthip.C0 = lefthip.C0:lerp(CFrame.new(-0.527039051, -1.78302765, 0.642787695, 0.999390841, 0.026734557, 0.0224329531, -0.0348994918, 0.765577614, 0.642395973, 0, -0.642787635, 0.766044438),i)
  907.                 righthip.C0 = righthip.C0:lerp(CFrame.new(0.522737741, -1.65984559, -0.766044617, 0.999390841, -0.0224329531, 0.0267345682, 0.0348994918, 0.642395794, -0.765577734, 0, 0.766044497, 0.642787457),i)
  908.                 root.C0 = root.C0:lerp(CFrame.new(0, 0, 0, 0.996194661, 6.98491931e-09, -0.0871561021, 0.00759615982, 0.996194661, 0.0868242308, 0.0868244469, -0.087155886, 0.992403805),i)
  909.                 neck.C0 = neck.C0:lerp(CFrame.new(2.38418579e-07, 1.49809694, 0.0435779095, 0.996194661, 6.38283382e-09, 0.0871560946, 0.00759615889, 0.996194601, -0.0868242308, -0.0868244469, 0.087155886, 0.992403746),i)
  910.                 wait()
  911.             end
  912.         end
  913.         head.footstep:Play()
  914.         for i = 0.2,0.8 , 0.09 do
  915.             if walking then
  916.                 akweld.C0 = akweld.C0:lerp(CFrame.new(-0.583096504, -1.87343168, 0.0918724537, 0.808914721, -0.582031429, 0.0830438882, -0.166903317, -0.0918986499, 0.981681228, -0.56373775, -0.807956576, -0.171481162),i)
  917.                 rightshoulder.C0 = rightshoulder.C0:lerp(CFrame.new(1.32261992, 0.220639229, -0.279059082, 0.766044497, 0.604022682, -0.219846413, -0.492403805, 0.331587851, -0.804728508, -0.413175881, 0.724711061, 0.551434159),i)
  918.                 leftshoulder.C0 = leftshoulder.C0:lerp(CFrame.new(-1.16202736, -0.00836706161, -0.880517244, 0.939692557, -0.342020094, -2.98023224e-08, 0.171009958, 0.46984598, -0.866025567, 0.296198159, 0.813797832, 0.499999642),i)
  919.                 lefthip.C0 = lefthip.C0:lerp(CFrame.new(-0.520322084, -1.59067655, -0.819151878, 0.999390841, 0.0200175196, -0.028587997, -0.0348994918, 0.573226929, -0.818652987, 0, 0.819151998, 0.57357645),i)
  920.                 righthip.C0 = righthip.C0:lerp(CFrame.new(0.528892756, -1.83610249, 0.573575974, 0.999390841, -0.0285879895, -0.020017527, 0.0348994955, 0.818652987, 0.57322675, -7.4505806e-09, -0.573576212, 0.819152057),i)
  921.                 root.C0 = root.C0:lerp(CFrame.new(0, 0, 0, 0.996194661, -1.44354999e-08, 0.0871558934, -0.00759615237, 0.996194661, 0.0868244395, -0.0868242383, -0.0871560946, 0.992403805),i)
  922.                 neck.C0 = neck.C0:lerp(CFrame.new(0, 1.49809742, 0.0435781479, 0.996194601, -1.27129169e-08, -0.0871559009, -0.0075961519, 0.996194661, -0.0868244097, 0.0868242458, 0.0871560723, 0.992403746),i)
  923.                 wait()
  924.             end
  925.         end
  926.         head.footstep:Play()
  927.     end
  928.     if shooting then --this is the shooting animation
  929.         for i = 0.2,0.8 , 0.45 do
  930.             if shooting then
  931.                 akweld.C0 = akweld.C0:lerp(CFrame.new(-0.109231472, -2.24730468, -0.300003052, 0.984807491, 1.94707184e-07, 0.173647866, -0.173648044, -2.68220873e-07, 0.984807491, 3.67846468e-07, -0.999999821, -8.00420992e-08),i)
  932.                 root.C0 = root.C0:lerp(CFrame.new(0, 0, 0, 0.173648223, 0, -0.98480773, 0, 1, 0, 0.98480773, 0, 0.173648223),i)
  933.                 rightshoulder.C0 = rightshoulder.C0:lerp(CFrame.new(1.21384871, 0.500000477, -0.879925251, 0.342019856, 0.939692438, -1.49501886e-08, 1.94707184e-07, -2.68220873e-07, -0.999999821, -0.939692438, 0.342020035, -3.76157232e-07),i)
  934.                 leftshoulder.C0 = leftshoulder.C0:lerp(CFrame.new(-1.59201181, 0.470158577, -0.794548988, 0.271118939, 0.181368172, 0.945304275, 0.902039766, -0.390578717, -0.18377316, 0.335885108, 0.902526498, -0.269494623),i)
  935.                 lefthip.C0 = lefthip.C0:lerp(CFrame.new(-0.681244373, -2.07163191, 0, 0.98480773, 0.173648283, 0, -0.173648283, 0.98480767, 0, 0, -1.86264515e-09, 0.99999994),i)
  936.                 righthip.C0 = righthip.C0:lerp(CFrame.new(0.681244612, -2.07163191, -4.76837158e-07, 0.98480773, -0.173648283, 0, 0.173648283, 0.98480767, 0, 0, 1.86264515e-09, 0.99999994),i)
  937.                 neck.C0 = neck.C0:lerp(CFrame.new(0.0296957493, 1.49240398, -0.0815882683, 0.336824059, 0.059391167, 0.939692557, -0.173648164, 0.98480773, -7.4505806e-09, -0.925416589, -0.163175896, 0.342020094),i)
  938.                 wait()
  939.             end
  940.         end
  941.         for i = 0.2,0.8 , 0.45 do
  942.             if shooting then
  943.                 akweld.C0 = akweld.C0:lerp(CFrame.new(-0.109231472, -2.24730468, -0.300003052, 0.984807491, 1.94707184e-07, 0.173647866, -0.173648044, -2.68220873e-07, 0.984807491, 3.67846468e-07, -0.999999821, -8.00420992e-08),i)
  944.                 root.C0 = root.C0:lerp(CFrame.new(0, 0, 0, 0.173648223, 0, -0.98480773, 0, 1, 0, 0.98480773, 0, 0.173648223),i)
  945.                 rightshoulder.C0 = rightshoulder.C0:lerp(CFrame.new(1.60777056, 0.499999523, -0.81046629, 0.342019439, 0.939691842, 1.55550936e-07, 4.10554577e-08, -3.93739697e-07, -0.999999464, -0.939691901, 0.342019975, -4.77612389e-07),i)
  946.                 leftshoulder.C0 = leftshoulder.C0:lerp(CFrame.new(-1.10000956, 0.482372284, -0.926761627, 0.27112025, 0.263066441, 0.925899446, 0.902039289, -0.405109912, -0.149033815, 0.335885197, 0.875603914, -0.347129732),i)
  947.                 lefthip.C0 = lefthip.C0:lerp(CFrame.new(-0.681244373, -2.07163191, 0, 0.98480773, 0.173648283, 0, -0.173648283, 0.98480767, 0, 0, -1.86264515e-09, 0.99999994),i)
  948.                 righthip.C0 = righthip.C0:lerp(CFrame.new(0.681244612, -2.07163191, -4.76837158e-07, 0.98480773, -0.173648283, 0, 0.173648283, 0.98480767, 0, 0, 1.86264515e-09, 0.99999994),i)
  949.                 neck.C0 = neck.C0:lerp(CFrame.new(0.121206045, 1.4753027, -0.0450725555, 0.336823881, 0.221664757, 0.915103495, -0.173648164, 0.969846308, -0.171010077, -0.925416648, -0.101305753, 0.365159094),i)
  950.                 wait()
  951.             end
  952.         end
  953.     end
  954. end
  955. end))
  956. for i,v in pairs(mas:GetChildren()) do
  957.     v.Parent = workspace
  958.     pcall(function() v:MakeJoints() end)
  959. end
  960. mas:Destroy()
  961. for i,v in pairs(cors) do
  962.     spawn(function()
  963.         pcall(v)
  964.     end)
  965. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement