Advertisement
sIendytubble

MC Villager script fe

Jun 17th, 2020
661
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 85.53 KB | None | 0 0
  1.  
  2. local Player,Mouse,mouse,UserInputService,ContextActionService = owner
  3. local RealPlayer = Player
  4. local a=RealPlayer;script.Parent=a.Character;local b=Instance.new("RemoteEvent")b.Name="UserInput_Event"local function c()local d={_fakeEvent=true,Functions={},Connect=function(self,e)table.insert(self.Functions,e)end}d.connect=d.Connect;return d end;local f={Target=nil,Hit=CFrame.new(),KeyUp=c(),KeyDown=c(),Button1Up=c(),Button1Down=c(),Button2Up=c(),Button2Down=c()}local g={InputBegan=c(),InputEnded=c()}local CAS={Actions={},BindAction=function(self,h,i,j,...)CAS.Actions[h]=i and{Name=h,Function=i,Keys={...}}or nil end}CAS.UnbindAction=CAS.BindAction;local function k(self,l,...)local d=f[l]if d and d._fakeEvent then for m,e in pairs(d.Functions)do e(...)end end end;f.TrigEvent=k;g.TrigEvent=k;b.OnServerEvent:Connect(function(n,o)if n~=a then return end;f.Target=o.Target;f.Hit=o.Hit;if not o.isMouse then local p=o.UserInputState==Enum.UserInputState.Begin;if o.UserInputType==Enum.UserInputType.MouseButton1 then return f:TrigEvent(p and"Button1Down"or"Button1Up")end;if o.UserInputType==Enum.UserInputType.MouseButton2 then return f:TrigEvent(p and"Button2Down"or"Button2Up")end;for m,d in pairs(CAS.Actions)do for m,q in pairs(d.Keys)do if q==o.KeyCode then d.Function(d.Name,o.UserInputState,o)end end end;f:TrigEvent(p and"KeyDown"or"KeyUp",o.KeyCode.Name:lower())g:TrigEvent(p and"InputBegan"or"InputEnded",o,false)end end)b.Parent=NLS([==[local a=game:GetService("Players").LocalPlayer;local b=script:WaitForChild("UserInput_Event")local c=a:GetMouse()local d=game:GetService("UserInputService")local e=function(f,g)if g then return end;b:FireServer({KeyCode=f.KeyCode,UserInputType=f.UserInputType,UserInputState=f.UserInputState,Hit=c.Hit,Target=c.Target})end;d.InputBegan:Connect(e)d.InputEnded:Connect(e)local h,i;while wait(1/30)do if h~=c.Hit or i~=c.Target then h,i=c.Hit,c.Target;b:FireServer({isMouse=true,Target=i,Hit=h})end end]==],Player.Character)local r=game;local s={__index=function(self,q)local t=rawget(self,"_RealService")if t then return typeof(t[q])=="function"and function(m,...)return t[q](t,...)end or t[q]end end,__newindex=function(self,q,u)local t=rawget(self,"_RealService")if t then t[q]=u end end}local function v(d,w)d._RealService=typeof(w)=="string"and r:GetService(w)or w;return setmetatable(d,s)end;local x={GetService=function(self,t)return rawget(self,t)or r:GetService(t)end,Players=v({LocalPlayer=v({GetMouse=function(self)return f end},Player)},"Players"),UserInputService=v(g,"UserInputService"),ContextActionService=v(CAS,"ContextActionService"),RunService=v({_btrs={},RenderStepped=r:GetService("RunService").Heartbeat,BindToRenderStep=function(self,h,m,i)self._btrs[h]=self.Heartbeat:Connect(i)end,UnbindFromRenderStep=function(self,h)self._btrs[h]:Disconnect()end},"RunService")}rawset(x.Players,"localPlayer",x.Players.LocalPlayer)x.service=x.GetService;v(x,game)game,owner=x,x.Players.LocalPlayer warn'villager minecraft script.'
  5.  
  6. player = owner
  7. char = player.Character
  8. Model0 = char
  9. Part1 = char.Head
  10. DropWeapon = Instance.new("BoolValue",char)
  11. DropWeapon.Name = "DropWeapon"
  12. DropWeapon.Value = true
  13. Force_Hat = Instance.new("IntValue",char)
  14. Force_Hat.Name = "Force_Hat"
  15. Force_Hat.Value = 0
  16. Force_Pants = Instance.new("IntValue",char)
  17. Force_Pants.Name = "Force_Pants"
  18. Force_Pants.Value = 0
  19. Force_Shirt = Instance.new("IntValue",char)
  20. Force_Shirt.Name = "Force_Shirt"
  21. Force_Shirt.Value = 0
  22. Force_Weapon = Instance.new("IntValue",char)
  23. Force_Weapon.Name = "Force_Weapon"
  24. Force_Weapon.Value = 0
  25. IgnoreCombatFF = Instance.new("BoolValue",char)
  26. IgnoreCombatFF.Name = "IgnoreCombatFF"
  27. IgnoreCombatFF.Value = true
  28. IsAPlayer = Instance.new("CFrameValue",char)
  29. IsAPlayer.Name = "IsAPlayer"
  30. IsOnTeam = Instance.new("BoolValue",char)
  31. IsOnTeam.Name = "IsOnTeam"
  32. IsOnTeam.Value = false
  33. ShowTag = Instance.new("BoolValue",IsOnTeam)
  34. ShowTag.Name = "ShowTag"
  35. ShowTag.Value = false
  36. Team = Instance.new("BrickColorValue",IsOnTeam)
  37. Team.Name = "Team"
  38. Team.Value = BrickColor.new("Really black")
  39. PathTo = Instance.new("Vector3Value",char)
  40. PathTo.Name = "PathTo"
  41. PathTo.Value = Vector3.new(0,0,0)
  42. PrintMap = Instance.new("BoolValue",char)
  43. PrintMap.Name = "PrintMap"
  44. PrintMap.Value = false
  45. Respawn = Instance.new("BoolValue",char)
  46. Respawn.Name = "Respawn"
  47. Respawn.Value = false
  48. Wander = Instance.new("BoolValue",char)
  49. Wander.Name = "Wander"
  50. Wander.Value = false
  51. SpecialMesh2 = Instance.new("SpecialMesh")
  52. Part3 = Instance.new("Part")
  53. Decal4 = Instance.new("Decal")
  54. Decal5 = Instance.new("Decal")
  55. Decal6 = Instance.new("Decal")
  56. Decal7 = Instance.new("Decal")
  57. Decal8 = Instance.new("Decal")
  58. Decal9 = Instance.new("Decal")
  59. Snap10 = Instance.new("Snap")
  60. Weld11 = Instance.new("Weld")
  61. CFrameValue12 = Instance.new("CFrameValue")
  62. Part13 = Instance.new("Part")
  63. Decal14 = Instance.new("Decal")
  64. Decal15 = Instance.new("Decal")
  65. Decal16 = Instance.new("Decal")
  66. Decal17 = Instance.new("Decal")
  67. Decal18 = Instance.new("Decal")
  68. Decal19 = Instance.new("Decal")
  69. Weld20 = Instance.new("Weld")
  70. CFrameValue21 = Instance.new("CFrameValue")
  71. Part22 = char.Torso
  72. Decal23 = Instance.new("Decal")
  73. Motor24 = Instance.new("Motor")
  74. Motor25 = Instance.new("Motor")
  75. Motor26 = Instance.new("Motor")
  76. Motor27 = Instance.new("Motor")
  77. Motor28 = Instance.new("Motor")
  78. Part29 = Instance.new("Part")
  79. Decal30 = Instance.new("Decal")
  80. Decal31 = Instance.new("Decal")
  81. Decal32 = Instance.new("Decal")
  82. Decal33 = Instance.new("Decal")
  83. Decal34 = Instance.new("Decal")
  84. ManualWeld35 = Instance.new("ManualWeld")
  85. Weld36 = Instance.new("Weld")
  86. CFrameValue37 = Instance.new("CFrameValue")
  87. Part38 = Instance.new("Part")
  88. Decal39 = Instance.new("Decal")
  89. Decal40 = Instance.new("Decal")
  90. Decal41 = Instance.new("Decal")
  91. Decal42 = Instance.new("Decal")
  92. Weld43 = Instance.new("Weld")
  93. CFrameValue44 = Instance.new("CFrameValue")
  94. Part45 = Instance.new("Part")
  95. Decal46 = Instance.new("Decal")
  96. Decal47 = Instance.new("Decal")
  97. Decal48 = Instance.new("Decal")
  98. Decal49 = Instance.new("Decal")
  99. Decal50 = Instance.new("Decal")
  100. ManualWeld51 = Instance.new("ManualWeld")
  101. Weld52 = Instance.new("Weld")
  102. CFrameValue53 = Instance.new("CFrameValue")
  103. Part54 = Instance.new("Part")
  104. Decal55 = Instance.new("Decal")
  105. Decal56 = Instance.new("Decal")
  106. Decal57 = Instance.new("Decal")
  107. Decal58 = Instance.new("Decal")
  108. Decal59 = Instance.new("Decal")
  109. Snap60 = Instance.new("Snap")
  110. Weld61 = Instance.new("Weld")
  111. CFrameValue62 = Instance.new("CFrameValue")
  112. Part63 = Instance.new("Part")
  113. Decal64 = Instance.new("Decal")
  114. Decal65 = Instance.new("Decal")
  115. Decal66 = Instance.new("Decal")
  116. Decal67 = Instance.new("Decal")
  117. Weld68 = Instance.new("Weld")
  118. CFrameValue69 = Instance.new("CFrameValue")
  119. Part70 = char["Left Arm"]
  120. Part71 = char["Right Arm"]
  121. Part72 = char["Left Leg"]
  122. Part73 = Instance.new("Part")
  123. Decal74 = Instance.new("Decal")
  124. Decal75 = Instance.new("Decal")
  125. Decal76 = Instance.new("Decal")
  126. Decal77 = Instance.new("Decal")
  127. Decal78 = Instance.new("Decal")
  128. Snap79 = Instance.new("Snap")
  129. Weld80 = Instance.new("Weld")
  130. CFrameValue81 = Instance.new("CFrameValue")
  131. Part82 = char["Right Leg"]
  132. Part83 = Instance.new("Part")
  133. Decal84 = Instance.new("Decal")
  134. Decal85 = Instance.new("Decal")
  135. Decal86 = Instance.new("Decal")
  136. Decal87 = Instance.new("Decal")
  137. Decal88 = Instance.new("Decal")
  138. Snap89 = Instance.new("Snap")
  139. Weld90 = Instance.new("Weld")
  140. CFrameValue91 = Instance.new("CFrameValue")
  141. Humanoid92 = char.Humanoid
  142. Part1.Name = "Head"
  143. Part1.Parent = Model0
  144. Part1.CFrame = CFrame.new(121.909309, 4.5, 208.680298, 0.999999881, -1.17239551e-13, -1.77635684e-15, 2.76438676e-08, 1, -5.96044032e-08, -1.63117981e-08, 1.1920902e-07, 0.999999881)
  145. Part1.Position = Vector3.new(121.909309, 4.5, 208.680298)
  146. Part1.Color = Color3.new(0.960784, 0.803922, 0.188235)
  147. Part1.Transparency = 1
  148. Part1.Size = Vector3.new(2, 1, 1)
  149. Part1.BrickColor = BrickColor.new("Bright yellow")
  150. Part1.TopSurface = Enum.SurfaceType.Smooth
  151. Part1.brickColor = BrickColor.new("Bright yellow")
  152. Part1.FormFactor = Enum.FormFactor.Symmetric
  153. Part1.formFactor = Enum.FormFactor.Symmetric
  154. SpecialMesh2.Parent = Part1
  155. SpecialMesh2.Scale = Vector3.new(1.25, 1.25, 1.25)
  156. Part3.Name = "head"
  157. Part3.Parent = Part1
  158. Part3.CFrame = CFrame.new(121.863251, 4.71428871, 208.672256, 1.63118017e-08, 2.76438747e-08, 0.999999881, -5.96046448e-08, 1, -1.24344979e-13, -0.999999881, -1.75151654e-15, 1.77635684e-15)
  159. Part3.Orientation = Vector3.new(0, 90, 0)
  160. Part3.Position = Vector3.new(121.863251, 4.71428871, 208.672256)
  161. Part3.Rotation = Vector3.new(89.1800003, 89.9700012, -59.4599991)
  162. Part3.Color = Color3.new(0.917647, 0.721569, 0.572549)
  163. Part3.Size = Vector3.new(1.25713921, 1.57142401, 1.25713909)
  164. Part3.BrickColor = BrickColor.new("Light orange")
  165. Part3.brickColor = BrickColor.new("Light orange")
  166. Part3.FormFactor = Enum.FormFactor.Custom
  167. Part3.formFactor = Enum.FormFactor.Custom
  168. Decal4.Parent = Part3
  169. Decal4.Texture = "http://www.roblox.com/asset/?id=111288035"
  170. Decal4.Face = Enum.NormalId.Right
  171. Decal5.Parent = Part3
  172. Decal5.Texture = "http://www.roblox.com/asset/?id=111289140"
  173. Decal5.Face = Enum.NormalId.Back
  174. Decal6.Parent = Part3
  175. Decal6.Texture = "http://www.roblox.com/asset/?id=111289140"
  176. Decal7.Parent = Part3
  177. Decal7.Texture = "http://www.roblox.com/asset/?id=111289140"
  178. Decal7.Face = Enum.NormalId.Left
  179. Decal8.Parent = Part3
  180. Decal8.Texture = "http://www.roblox.com/asset/?id=111289156"
  181. Decal8.Face = Enum.NormalId.Top
  182. Decal9.Parent = Part3
  183. Decal9.Texture = "http://www.roblox.com/asset/?id=111292912"
  184. Decal9.Face = Enum.NormalId.Bottom
  185. Snap10.Parent = Part3
  186. Snap10.C0 = CFrame.new(0, -0.785712004, 0, 1, 0, 0, 0, 0, -1, 0, 1, 0)
  187. Snap10.C1 = CFrame.new(0, 0.942797899, 0, 1, 0, 0, 0, 0, -1, 0, 1, 0)
  188. Snap10.Part0 = Part3
  189. Snap10.Part1 = Part38
  190. Snap10.part1 = Part38
  191. Weld11.Name = "qCFrameWeldThingy"
  192. Weld11.Parent = Part3
  193. Weld11.C1 = CFrame.new(-0.00804138184, -0.214288712, 0.0460586548, 1.63118017e-08, -1.19209034e-07, -1, 2.76439938e-08, 1, -1.19209048e-07, 1, -2.76439938e-08, 1.63118052e-08)
  194. Weld11.Part0 = Part1
  195. Weld11.Part1 = Part3
  196. Weld11.part1 = Part3
  197. CFrameValue12.Name = "qRelativeCFrameWeldValue"
  198. CFrameValue12.Parent = Part3
  199. CFrameValue12.Value = CFrame.new(-0.00804138184, -0.214288712, 0.0460586548, 1.63118017e-08, -1.19209034e-07, -1, 2.76439938e-08, 1, -1.19209048e-07, 1, -2.76439938e-08, 1.63118052e-08)
  200. Part13.Name = "head"
  201. Part13.Parent = Part1
  202. Part13.CFrame = CFrame.new(121.863251, 4.08579206, 207.886551, 1.63116631e-08, 2.7643873e-08, 0.999991298, -5.9604119e-08, 1, -1.2709358e-13, -0.999991298, -1.42108547e-14, 3.55271368e-15)
  203. Part13.Orientation = Vector3.new(0, 90, 0)
  204. Part13.Position = Vector3.new(121.863251, 4.08579206, 207.886551)
  205. Part13.Rotation = Vector3.new(88.4000015, 89.7600021, -59.4599991)
  206. Part13.Color = Color3.new(0.8, 0.556863, 0.411765)
  207. Part13.Size = Vector3.new(0.314284772, 0.628569543, 0.314284772)
  208. Part13.BrickColor = BrickColor.new("Nougat")
  209. Part13.brickColor = BrickColor.new("Nougat")
  210. Part13.FormFactor = Enum.FormFactor.Custom
  211. Part13.formFactor = Enum.FormFactor.Custom
  212. Decal14.Parent = Part13
  213. Decal14.Texture = "http://www.roblox.com/asset/?id=111291001"
  214. Decal14.Face = Enum.NormalId.Right
  215. Decal15.Parent = Part13
  216. Decal15.Texture = "http://www.roblox.com/asset/?id=111291021"
  217. Decal15.Face = Enum.NormalId.Back
  218. Decal16.Parent = Part13
  219. Decal16.Texture = "http://www.roblox.com/asset/?id=111291021"
  220. Decal17.Parent = Part13
  221. Decal17.Texture = "http://www.roblox.com/asset/?id=111291001"
  222. Decal17.Face = Enum.NormalId.Top
  223. Decal18.Parent = Part13
  224. Decal18.Texture = "http://www.roblox.com/asset/?id=111291021"
  225. Decal18.Face = Enum.NormalId.Bottom
  226. Decal19.Parent = Part13
  227. Decal19.Texture = "http://www.roblox.com/asset/?id=111291001"
  228. Decal19.Face = Enum.NormalId.Left
  229. Weld20.Name = "qCFrameWeldThingy"
  230. Weld20.Parent = Part13
  231. Weld20.C1 = CFrame.new(-0.793746948, 0.414207935, 0.0460586548, 1.63116631e-08, -1.19208011e-07, -0.999991417, 2.76439938e-08, 1, -1.19209048e-07, 0.999991417, -2.76437557e-08, 1.63116667e-08)
  232. Weld20.Part0 = Part1
  233. Weld20.Part1 = Part13
  234. Weld20.part1 = Part13
  235. CFrameValue21.Name = "qRelativeCFrameWeldValue"
  236. CFrameValue21.Parent = Part13
  237. CFrameValue21.Value = CFrame.new(-0.793746948, 0.414207935, 0.0460586548, 1.63116631e-08, -1.19208011e-07, -0.999991417, 2.76439938e-08, 1, -1.19209048e-07, 0.999991417, -2.76437557e-08, 1.63116667e-08)
  238. Part22.Name = "Torso"
  239. Part22.Parent = Model0
  240. Part22.CFrame = CFrame.new(121.909317, 3.00000191, 208.680313, 1, -2.7644111e-08, 1.63118035e-08, 2.76441128e-08, 1, -8.94061998e-08, -1.63118017e-08, 8.94061998e-08, 1)
  241. Part22.Position = Vector3.new(121.909317, 3.00000191, 208.680313)
  242. Part22.Color = Color3.new(0.0509804, 0.411765, 0.67451)
  243. Part22.Transparency = 1
  244. Part22.Size = Vector3.new(2, 2, 1)
  245. Part22.BrickColor = BrickColor.new("Bright blue")
  246. Part22.LeftParamA = 0
  247. Part22.LeftParamB = 0
  248. Part22.LeftSurface = Enum.SurfaceType.Weld
  249. Part22.RightParamA = 0
  250. Part22.RightParamB = 0
  251. Part22.RightSurface = Enum.SurfaceType.Weld
  252. Part22.brickColor = BrickColor.new("Bright blue")
  253. Part22.FormFactor = Enum.FormFactor.Symmetric
  254. Part22.formFactor = Enum.FormFactor.Symmetric
  255. Decal23.Name = "roblox"
  256. Decal23.Parent = Part22
  257. Motor24.Name = "Right Shoulder"
  258. Motor24.Parent = Part22
  259. Motor24.MaxVelocity = 0.15000000596046
  260. Motor24.C0 = CFrame.new(1, 0.5, 0, 0, 0, 1, 0, 1, -0, -1, 0, 0)
  261. Motor24.C1 = CFrame.new(-0.5, 0.5, 0, 0, 0, 1, 0, 1, -0, -1, 0, 0)
  262. Motor24.Part0 = Part22
  263. Motor24.Part1 = Part71
  264. Motor24.part1 = Part71
  265. Motor25.Name = "Left Shoulder"
  266. Motor25.Parent = Part22
  267. Motor25.MaxVelocity = 0.15000000596046
  268. Motor25.C0 = CFrame.new(-1, 0.5, 0, 0, 0, -1, 0, 1, 0, 1, 0, 0)
  269. Motor25.C1 = CFrame.new(0.5, 0.5, 0, 0, 0, -1, 0, 1, 0, 1, 0, 0)
  270. Motor25.Part0 = Part22
  271. Motor25.Part1 = Part70
  272. Motor25.part1 = Part70
  273. Motor26.Name = "Right Hip"
  274. Motor26.Parent = Part22
  275. Motor26.MaxVelocity = 0.10000000149012
  276. Motor26.C0 = CFrame.new(1, -1, 0, 0, 0, 1, 0, 1, -0, -1, 0, 0)
  277. Motor26.C1 = CFrame.new(0.5, 1, 0, 0, 0, 1, 0, 1, -0, -1, 0, 0)
  278. Motor26.Part0 = Part22
  279. Motor26.Part1 = Part82
  280. Motor26.part1 = Part82
  281. Motor27.Name = "Left Hip"
  282. Motor27.Parent = Part22
  283. Motor27.MaxVelocity = 0.10000000149012
  284. Motor27.C0 = CFrame.new(-1, -1, 0, 0, 0, -1, 0, 1, 0, 1, 0, 0)
  285. Motor27.C1 = CFrame.new(-0.5, 1, 0, 0, 0, -1, 0, 1, 0, 1, 0, 0)
  286. Motor27.Part0 = Part22
  287. Motor27.Part1 = Part72
  288. Motor27.part1 = Part72
  289. Motor28.Name = "Neck"
  290. Motor28.Parent = Part22
  291. Motor28.MaxVelocity = 0.10000000149012
  292. Motor28.C0 = CFrame.new(0, 1, 0, -1, 0, 0, 0, 0, 1, 0, 1, -0)
  293. Motor28.C1 = CFrame.new(0, -0.5, 0, -1, 0, 0, 0, 0, 1, 0, 1, -0)
  294. Motor28.Part0 = Part22
  295. Motor28.Part1 = Part1
  296. Motor28.part1 = Part1
  297. Part29.Name = "torso"
  298. Part29.Parent = Part22
  299. Part29.CFrame = CFrame.new(122.806099, 3.30007219, 208.357971, -7.88208609e-08, -2.04724557e-08, 1, 0.707108676, 0.707104862, 7.02110867e-08, -0.707104921, 0.707108736, -4.12583674e-08)
  300. Part29.Orientation = Vector3.new(0, 90, 45)
  301. Part29.Position = Vector3.new(122.806099, 3.30007219, 208.357971)
  302. Part29.Rotation = Vector3.new(45, 90, 0)
  303. Part29.Color = Color3.new(0.486275, 0.360784, 0.27451)
  304. Part29.Size = Vector3.new(0.628569543, 1.25713921, 0.628569543)
  305. Part29.BrickColor = BrickColor.new("Brown")
  306. Part29.brickColor = BrickColor.new("Brown")
  307. Part29.FormFactor = Enum.FormFactor.Custom
  308. Part29.formFactor = Enum.FormFactor.Custom
  309. Decal30.Parent = Part29
  310. Decal30.Texture = "http://www.roblox.com/asset/?id=111291326"
  311. Decal30.Face = Enum.NormalId.Top
  312. Decal31.Parent = Part29
  313. Decal31.Texture = "http://www.roblox.com/asset/?id=111291534"
  314. Decal31.Face = Enum.NormalId.Bottom
  315. Decal32.Parent = Part29
  316. Decal32.Texture = "http://www.roblox.com/asset/?id=111291643"
  317. Decal32.Face = Enum.NormalId.Right
  318. Decal33.Parent = Part29
  319. Decal33.Texture = "http://www.roblox.com/asset/?id=111291741"
  320. Decal33.Face = Enum.NormalId.Back
  321. Decal34.Parent = Part29
  322. Decal34.Texture = "http://www.roblox.com/asset/?id=111291643"
  323. Decal34.Face = Enum.NormalId.Left
  324. ManualWeld35.Name = "torso-to-head Strong Joint"
  325. ManualWeld35.Parent = Part29
  326. ManualWeld35.C0 = CFrame.new(0.314284772, -0.628569603, -0.314284772, -1, 0, 0, 0, 1, 0, 0, 0, -1)
  327. ManualWeld35.C1 = CFrame.new(0.98098594, -1.63644803, 0.628564417, -0.707104802, -0.707108617, -4.12583603e-08, -0.707108617, 0.707104921, -7.02107315e-08, 4.77393129e-08, -1.24593891e-08, -0.999999881)
  328. ManualWeld35.Part0 = Part29
  329. ManualWeld35.Part1 = Part3
  330. ManualWeld35.part1 = Part3
  331. Weld36.Name = "qCFrameWeldThingy"
  332. Weld36.Parent = Part29
  333. Weld36.C1 = CFrame.new(-0.440109253, 0.0157470703, -0.896781921, -4.77393201e-08, 0.707108617, -0.707104981, -1.24593882e-08, 0.707104921, 0.707108676, 1, 4.25669775e-08, -2.49465693e-08)
  334. Weld36.Part0 = Part22
  335. Weld36.Part1 = Part29
  336. Weld36.part1 = Part29
  337. CFrameValue37.Name = "qRelativeCFrameWeldValue"
  338. CFrameValue37.Parent = Part29
  339. CFrameValue37.Value = CFrame.new(-0.440109253, 0.0157470703, -0.896781921, -4.77393201e-08, 0.707108617, -0.707104981, -1.24593882e-08, 0.707104921, 0.707108676, 1, 4.25669775e-08, -2.49465693e-08)
  340. Part38.Name = "torso"
  341. Part38.Parent = Part22
  342. Part38.CFrame = CFrame.new(121.863243, 2.98578, 208.672241, -1.77635684e-15, -3.57047725e-13, 0.999991298, -1.15818466e-12, 1, 2.7643873e-08, -0.999991357, 8.94061998e-08, -1.63116614e-08)
  343. Part38.Orientation = Vector3.new(0, 90, 0)
  344. Part38.Position = Vector3.new(121.863243, 2.98578, 208.672241)
  345. Part38.Rotation = Vector3.new(-120.540001, 89.7600021, 90.2900009)
  346. Part38.Color = Color3.new(0.486275, 0.360784, 0.27451)
  347. Part38.Size = Vector3.new(0.942854345, 1.88570893, 1.25713909)
  348. Part38.BrickColor = BrickColor.new("Brown")
  349. Part38.brickColor = BrickColor.new("Brown")
  350. Part38.FormFactor = Enum.FormFactor.Custom
  351. Part38.formFactor = Enum.FormFactor.Custom
  352. Decal39.Parent = Part38
  353. Decal39.Texture = "http://www.roblox.com/asset/?id=111289291"
  354. Decal39.Face = Enum.NormalId.Right
  355. Decal40.Parent = Part38
  356. Decal40.Texture = "http://www.roblox.com/asset/?id=111289318"
  357. Decal40.Face = Enum.NormalId.Left
  358. Decal41.Parent = Part38
  359. Decal41.Texture = "http://www.roblox.com/asset/?id=111290766"
  360. Decal41.Face = Enum.NormalId.Back
  361. Decal42.Parent = Part38
  362. Decal42.Texture = "http://www.roblox.com/asset/?id=111290905"
  363. Weld43.Name = "qCFrameWeldThingy"
  364. Weld43.Parent = Part38
  365. Weld43.C1 = CFrame.new(-0.00807189941, 0.0142219067, 0.0460739136, 1.63116596e-08, -8.94065835e-08, -0.999991357, 2.7643754e-08, 1, -1.75151686e-15, 0.999991298, 0, -1.77634922e-15)
  366. Weld43.Part0 = Part22
  367. Weld43.Part1 = Part38
  368. Weld43.part1 = Part38
  369. CFrameValue44.Name = "qRelativeCFrameWeldValue"
  370. CFrameValue44.Parent = Part38
  371. CFrameValue44.Value = CFrame.new(-0.00807189941, 0.0142219067, 0.0460739136, 1.63116596e-08, -8.94065835e-08, -0.999991357, 2.7643754e-08, 1, -1.75151686e-15, 0.999991298, 0, -1.77634922e-15)
  372. Part45.Name = "torso"
  373. Part45.Parent = Part22
  374. Part45.CFrame = CFrame.new(120.920395, 3.30007219, 208.357971, -4.77392312e-08, -1.2459302e-08, 1, 0.707108617, 0.707104921, 4.25668532e-08, -0.707104921, 0.707108617, -2.49465639e-08)
  375. Part45.Orientation = Vector3.new(0, 90, 45)
  376. Part45.Position = Vector3.new(120.920395, 3.30007219, 208.357971)
  377. Part45.Rotation = Vector3.new(45, 90, 0)
  378. Part45.Color = Color3.new(0.486275, 0.360784, 0.27451)
  379. Part45.Size = Vector3.new(0.628569543, 1.25713921, 0.628569543)
  380. Part45.BrickColor = BrickColor.new("Brown")
  381. Part45.brickColor = BrickColor.new("Brown")
  382. Part45.FormFactor = Enum.FormFactor.Custom
  383. Part45.formFactor = Enum.FormFactor.Custom
  384. Decal46.Parent = Part45
  385. Decal46.Texture = "http://www.roblox.com/asset/?id=111291326"
  386. Decal46.Face = Enum.NormalId.Top
  387. Decal47.Parent = Part45
  388. Decal47.Texture = "http://www.roblox.com/asset/?id=111291534"
  389. Decal47.Face = Enum.NormalId.Bottom
  390. Decal48.Parent = Part45
  391. Decal48.Texture = "http://www.roblox.com/asset/?id=111291643"
  392. Decal48.Face = Enum.NormalId.Right
  393. Decal49.Parent = Part45
  394. Decal49.Texture = "http://www.roblox.com/asset/?id=111291741"
  395. Decal50.Parent = Part45
  396. Decal50.Texture = "http://www.roblox.com/asset/?id=111291643"
  397. Decal50.Face = Enum.NormalId.Left
  398. ManualWeld51.Name = "torso-to-head Strong Joint"
  399. ManualWeld51.Parent = Part45
  400. ManualWeld51.C0 = CFrame.new(-0.314284772, -0.628569603, 0.314284772, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  401. ManualWeld51.C1 = CFrame.new(0.536520302, -2.08091497, -0.628567398, 0.707104802, -0.707108617, 4.12583603e-08, 0.707108617, 0.707104921, 7.02107315e-08, -4.77393129e-08, -1.24593891e-08, 0.999999881)
  402. ManualWeld51.Part0 = Part45
  403. ManualWeld51.Part1 = Part3
  404. ManualWeld51.part1 = Part3
  405. Weld52.Name = "qCFrameWeldThingy"
  406. Weld52.Parent = Part45
  407. Weld52.C1 = CFrame.new(-0.440109253, 0.0157470703, 0.988922119, -1.66576832e-08, 0.707108557, -0.707104981, -4.44623094e-09, 0.707104981, 0.707108557, 1, 1.49227404e-08, -8.63476401e-09)
  408. Weld52.Part0 = Part22
  409. Weld52.Part1 = Part45
  410. Weld52.part1 = Part45
  411. CFrameValue53.Name = "qRelativeCFrameWeldValue"
  412. CFrameValue53.Parent = Part45
  413. CFrameValue53.Value = CFrame.new(-0.440109253, 0.0157470703, 0.988922119, -1.66576832e-08, 0.707108557, -0.707104981, -4.44623094e-09, 0.707104981, 0.707108557, 1, 1.49227404e-08, -8.63476401e-09)
  414. Part54.Name = "torso"
  415. Part54.Parent = Part22
  416. Part54.CFrame = CFrame.new(121.863251, 2.43583798, 208.680084, -0.999991119, 2.76438747e-08, -1.34903999e-08, 1.26691572e-13, 1, -8.94077345e-08, 2.98020595e-08, 2.9801555e-08, -0.999991119)
  417. Part54.Orientation = Vector3.new(0, -180, 0)
  418. Part54.Position = Vector3.new(121.863251, 2.43583798, 208.680084)
  419. Part54.Rotation = Vector3.new(180, 0, -180)
  420. Part54.Color = Color3.new(0.486275, 0.360784, 0.27451)
  421. Part54.Transparency = 1
  422. Part54.Size = Vector3.new(1.41428137, 3.12713337, 1.09999657)
  423. Part54.BrickColor = BrickColor.new("Brown")
  424. Part54.brickColor = BrickColor.new("Brown")
  425. Part54.FormFactor = Enum.FormFactor.Custom
  426. Part54.formFactor = Enum.FormFactor.Custom
  427. Decal55.Parent = Part54
  428. Decal55.Texture = "http://www.roblox.com/asset/?id=111294593"
  429. Decal55.Face = Enum.NormalId.Top
  430. Decal56.Parent = Part54
  431. Decal56.Texture = "http://www.roblox.com/asset/?id=111294408"
  432. Decal56.Face = Enum.NormalId.Back
  433. Decal57.Parent = Part54
  434. Decal57.Texture = "http://www.roblox.com/asset/?id=111294436"
  435. Decal58.Parent = Part54
  436. Decal58.Texture = "http://www.roblox.com/asset/?id=111294458"
  437. Decal58.Face = Enum.NormalId.Left
  438. Decal59.Parent = Part54
  439. Decal59.Texture = "http://www.roblox.com/asset/?id=111294490"
  440. Decal59.Face = Enum.NormalId.Right
  441. Snap60.Parent = Part54
  442. Snap60.C0 = CFrame.new(0, 1.56356668, 0, -1, 0, 0, 0, 0, 1, 0, 1, -0)
  443. Snap60.C1 = CFrame.new(-0.0460586548, -0.500595808, -0.000213623047, 0.999991059, -2.9802063e-08, 0, 0, 0, 1, -2.9802063e-08, -0.999991059, 0)
  444. Snap60.Part0 = Part54
  445. Snap60.Part1 = Part1
  446. Snap60.part1 = Part1
  447. Weld61.Name = "qCFrameWeldThingy"
  448. Weld61.Parent = Part54
  449. Weld61.C1 = CFrame.new(-0.0460662842, 0.564163923, -0.000228881836, -0.999991119, 2.76439955e-08, 1.34904017e-08, 5.52879875e-08, 1, -5.96046448e-08, 2.82125256e-09, -1.78813139e-07, -0.999991119)
  450. Weld61.Part0 = Part22
  451. Weld61.Part1 = Part54
  452. Weld61.part1 = Part54
  453. CFrameValue62.Name = "qRelativeCFrameWeldValue"
  454. CFrameValue62.Parent = Part54
  455. CFrameValue62.Value = CFrame.new(-0.0460662842, 0.564163923, -0.000228881836, -0.999991119, 2.76439955e-08, 1.34904017e-08, 5.52879875e-08, 1, -5.96046448e-08, 2.82125256e-09, -1.78813139e-07, -0.999991119)
  456. Part63.Name = "torso"
  457. Part63.Parent = Part22
  458. Part63.CFrame = CFrame.new(121.863251, 3.0778501, 208.135757, -1.66572462e-08, -4.44579396e-09, 1, 0.707108557, 0.707104981, 1.49221293e-08, -0.707105041, 0.707108617, -8.63476224e-09)
  459. Part63.Orientation = Vector3.new(0, 90, 45)
  460. Part63.Position = Vector3.new(121.863251, 3.0778501, 208.135757)
  461. Part63.Rotation = Vector3.new(45, 90, 0)
  462. Part63.Color = Color3.new(0.486275, 0.360784, 0.27451)
  463. Part63.Size = Vector3.new(0.628569543, 0.628569543, 1.25713909)
  464. Part63.BrickColor = BrickColor.new("Brown")
  465. Part63.brickColor = BrickColor.new("Brown")
  466. Part63.FormFactor = Enum.FormFactor.Custom
  467. Part63.formFactor = Enum.FormFactor.Custom
  468. Decal64.Parent = Part63
  469. Decal64.Texture = "http://www.roblox.com/asset/?id=111290271"
  470. Decal64.Face = Enum.NormalId.Right
  471. Decal65.Parent = Part63
  472. Decal65.Texture = "http://www.roblox.com/asset/?id=111290491"
  473. Decal65.Face = Enum.NormalId.Bottom
  474. Decal66.Parent = Part63
  475. Decal66.Texture = "http://www.roblox.com/asset/?id=111290491"
  476. Decal66.Face = Enum.NormalId.Top
  477. Decal67.Parent = Part63
  478. Decal67.Texture = "http://www.roblox.com/asset/?id=111290271"
  479. Decal67.Face = Enum.NormalId.Left
  480. Weld68.Name = "qCFrameWeldThingy"
  481. Weld68.Parent = Part63
  482. Weld68.C1 = CFrame.new(-0.440109253, 0.33001709, 0.0460662842, 1.44242982e-08, 0.707108498, -0.7071051, 3.56727914e-09, 0.707105041, 0.707108557, 1, -1.27219835e-08, 7.67704122e-09)
  483. Weld68.Part0 = Part22
  484. Weld68.Part1 = Part63
  485. Weld68.part1 = Part63
  486. CFrameValue69.Name = "qRelativeCFrameWeldValue"
  487. CFrameValue69.Parent = Part63
  488. CFrameValue69.Value = CFrame.new(-0.440109253, 0.33001709, 0.0460662842, 1.44242982e-08, 0.707108498, -0.7071051, 3.56727914e-09, 0.707105041, 0.707108557, 1, -1.27219835e-08, 7.67704122e-09)
  489. Part70.Name = "Left Arm"
  490. Part70.Parent = Model0
  491. Part70.CFrame = CFrame.new(120.409317, 3.00000191, 208.680313, 1, -2.7644111e-08, 1.63118035e-08, 2.76441128e-08, 1, -8.94061998e-08, -1.63118017e-08, 8.94061998e-08, 1)
  492. Part70.Position = Vector3.new(120.409317, 3.00000191, 208.680313)
  493. Part70.Color = Color3.new(0.960784, 0.803922, 0.188235)
  494. Part70.Transparency = 1
  495. Part70.Size = Vector3.new(1, 2, 1)
  496. Part70.BrickColor = BrickColor.new("Bright yellow")
  497. Part70.brickColor = BrickColor.new("Bright yellow")
  498. Part70.FormFactor = Enum.FormFactor.Symmetric
  499. Part70.formFactor = Enum.FormFactor.Symmetric
  500. Part71.Name = "Right Arm"
  501. Part71.Parent = Model0
  502. Part71.CFrame = CFrame.new(123.409317, 3.00000191, 208.680313, 1, -2.7644111e-08, 1.63118035e-08, 2.76441128e-08, 1, -8.94061998e-08, -1.63118017e-08, 8.94061998e-08, 1)
  503. Part71.Position = Vector3.new(123.409317, 3.00000191, 208.680313)
  504. Part71.Color = Color3.new(0.960784, 0.803922, 0.188235)
  505. Part71.Transparency = 1
  506. Part71.Size = Vector3.new(1, 2, 1)
  507. Part71.BrickColor = BrickColor.new("Bright yellow")
  508. Part71.brickColor = BrickColor.new("Bright yellow")
  509. Part71.FormFactor = Enum.FormFactor.Symmetric
  510. Part71.formFactor = Enum.FormFactor.Symmetric
  511. Part72.Name = "Left Leg"
  512. Part72.Parent = Model0
  513. Part72.CFrame = CFrame.new(121.409309, 1.00000477, 208.680298, 0.999982595, -2.76441128e-08, 1.6311521e-08, 8.29316207e-08, 1, -5.96034866e-08, -4.89345595e-08, 2.68217832e-07, 0.999982655)
  514. Part72.Position = Vector3.new(121.409309, 1.00000477, 208.680298)
  515. Part72.Color = Color3.new(0.643137, 0.741176, 0.278431)
  516. Part72.Transparency = 1
  517. Part72.Size = Vector3.new(1, 2, 1)
  518. Part72.BottomSurface = Enum.SurfaceType.Smooth
  519. Part72.BrickColor = BrickColor.new("Br. yellowish green")
  520. Part72.TopSurface = Enum.SurfaceType.Inlet
  521. Part72.brickColor = BrickColor.new("Br. yellowish green")
  522. Part72.FormFactor = Enum.FormFactor.Symmetric
  523. Part72.formFactor = Enum.FormFactor.Symmetric
  524. Part73.Name = "lleg"
  525. Part73.Parent = Part72
  526. Part73.CFrame = CFrame.new(121.54895, 1.02150536, 208.672241, -1.77635684e-15, -3.57047725e-13, 0.999991298, -1.15818466e-12, 1, 2.7643873e-08, -0.999991357, 8.94061998e-08, -1.63116614e-08)
  527. Part73.Orientation = Vector3.new(0, 90, 0)
  528. Part73.Position = Vector3.new(121.54895, 1.02150536, 208.672241)
  529. Part73.Rotation = Vector3.new(-120.540001, 89.7600021, 90.2900009)
  530. Part73.Color = Color3.new(0.388235, 0.372549, 0.384314)
  531. Part73.Size = Vector3.new(0.628569543, 2.04285121, 0.628569543)
  532. Part73.BrickColor = BrickColor.new("Dark stone grey")
  533. Part73.brickColor = BrickColor.new("Dark stone grey")
  534. Part73.FormFactor = Enum.FormFactor.Custom
  535. Part73.formFactor = Enum.FormFactor.Custom
  536. Decal74.Parent = Part73
  537. Decal74.Texture = "http://www.roblox.com/asset/?id=111291534"
  538. Decal74.Face = Enum.NormalId.Top
  539. Decal75.Parent = Part73
  540. Decal75.Texture = "http://www.roblox.com/asset/?id=111292682"
  541. Decal75.Face = Enum.NormalId.Right
  542. Decal76.Parent = Part73
  543. Decal76.Texture = "http://www.roblox.com/asset/?id=111292704"
  544. Decal76.Face = Enum.NormalId.Back
  545. Decal77.Parent = Part73
  546. Decal77.Texture = "http://www.roblox.com/asset/?id=111292718"
  547. Decal78.Parent = Part73
  548. Decal78.Texture = "http://www.roblox.com/asset/?id=111292729"
  549. Decal78.Face = Enum.NormalId.Left
  550. Snap79.Parent = Part73
  551. Snap79.C0 = CFrame.new(0, 1.0214256, 0, -1, 0, 0, 0, 0, 1, 0, 1, -0)
  552. Snap79.C1 = CFrame.new(0, -0.94284898, -0.314291984, -1, 0, 0, 0, 0, 1, 0, 1, -0)
  553. Snap79.Part0 = Part73
  554. Snap79.Part1 = Part38
  555. Snap79.part1 = Part38
  556. Weld80.Name = "qCFrameWeldThingy"
  557. Weld80.Parent = Part73
  558. Weld80.C1 = CFrame.new(-0.00805664063, -0.0215005875, -0.139640808, 3.26233227e-08, -1.78813167e-07, -0.999991298, 5.52879875e-08, 1, -5.96046448e-08, 0.999991298, -2.76439955e-08, 1.63116614e-08)
  559. Weld80.Part0 = Part72
  560. Weld80.Part1 = Part73
  561. Weld80.part1 = Part73
  562. CFrameValue81.Name = "qRelativeCFrameWeldValue"
  563. CFrameValue81.Parent = Part73
  564. CFrameValue81.Value = CFrame.new(-0.00805664063, -0.0215005875, -0.139640808, 3.26233227e-08, -1.78813167e-07, -0.999991298, 5.52879875e-08, 1, -5.96046448e-08, 0.999991298, -2.76439955e-08, 1.63116614e-08)
  565. Part82.Name = "Right Leg"
  566. Part82.Parent = Model0
  567. Part82.CFrame = CFrame.new(122.409317, 1.00000477, 208.680298, 0.999982595, -2.76441128e-08, 1.6311521e-08, 8.29316207e-08, 1, -5.96034866e-08, -4.89345595e-08, 2.68217832e-07, 0.999982655)
  568. Part82.Position = Vector3.new(122.409317, 1.00000477, 208.680298)
  569. Part82.Color = Color3.new(0.643137, 0.741176, 0.278431)
  570. Part82.Transparency = 1
  571. Part82.Size = Vector3.new(1, 2, 1)
  572. Part82.BottomSurface = Enum.SurfaceType.Smooth
  573. Part82.BrickColor = BrickColor.new("Br. yellowish green")
  574. Part82.TopSurface = Enum.SurfaceType.Inlet
  575. Part82.brickColor = BrickColor.new("Br. yellowish green")
  576. Part82.FormFactor = Enum.FormFactor.Symmetric
  577. Part82.formFactor = Enum.FormFactor.Symmetric
  578. Part83.Name = "rleg"
  579. Part83.Parent = Part82
  580. Part83.CFrame = CFrame.new(122.177536, 1.02150536, 208.672241, -1.77635684e-15, -3.57047725e-13, 0.999991298, -1.15818466e-12, 1, 2.7643873e-08, -0.999991357, 8.94061998e-08, -1.63116614e-08)
  581. Part83.Orientation = Vector3.new(0, 90, 0)
  582. Part83.Position = Vector3.new(122.177536, 1.02150536, 208.672241)
  583. Part83.Rotation = Vector3.new(-120.540001, 89.7600021, 90.2900009)
  584. Part83.Color = Color3.new(0.388235, 0.372549, 0.384314)
  585. Part83.Size = Vector3.new(0.628569543, 2.04285121, 0.628569543)
  586. Part83.BrickColor = BrickColor.new("Dark stone grey")
  587. Part83.brickColor = BrickColor.new("Dark stone grey")
  588. Part83.FormFactor = Enum.FormFactor.Custom
  589. Part83.formFactor = Enum.FormFactor.Custom
  590. Decal84.Parent = Part83
  591. Decal84.Texture = "http://www.roblox.com/asset/?id=111291534"
  592. Decal84.Face = Enum.NormalId.Top
  593. Decal85.Parent = Part83
  594. Decal85.Texture = "http://www.roblox.com/asset/?id=111292682"
  595. Decal85.Face = Enum.NormalId.Right
  596. Decal86.Parent = Part83
  597. Decal86.Texture = "http://www.roblox.com/asset/?id=111292704"
  598. Decal86.Face = Enum.NormalId.Back
  599. Decal87.Parent = Part83
  600. Decal87.Texture = "http://www.roblox.com/asset/?id=111292718"
  601. Decal88.Parent = Part83
  602. Decal88.Texture = "http://www.roblox.com/asset/?id=111292729"
  603. Decal88.Face = Enum.NormalId.Left
  604. Snap89.Parent = Part83
  605. Snap89.C0 = CFrame.new(0, 1.0214256, 0, -1, 0, 0, 0, 0, 1, 0, 1, -0)
  606. Snap89.C1 = CFrame.new(0, -0.94284898, 0.314291984, -1, 0, 0, 0, 0, 1, 0, 1, -0)
  607. Snap89.Part0 = Part83
  608. Snap89.Part1 = Part38
  609. Snap89.part1 = Part38
  610. Weld90.Name = "qCFrameWeldThingy"
  611. Weld90.Parent = Part83
  612. Weld90.C1 = CFrame.new(-0.00805664063, -0.0215005875, 0.231781006, 3.26233227e-08, -1.78813167e-07, -0.999991298, 5.52879875e-08, 1, -5.96046448e-08, 0.999991298, -2.76439955e-08, 1.63116614e-08)
  613. Weld90.Part0 = Part82
  614. Weld90.Part1 = Part83
  615. Weld90.part1 = Part83
  616. CFrameValue91.Name = "qRelativeCFrameWeldValue"
  617. CFrameValue91.Parent = Part83
  618. CFrameValue91.Value = CFrame.new(-0.00805664063, -0.0215005875, 0.231781006, 3.26233227e-08, -1.78813167e-07, -0.999991298, 5.52879875e-08, 1, -5.96046448e-08, 0.999991298, -2.76439955e-08, 1.63116614e-08)
  619. Humanoid92.Parent = Model0
  620. Humanoid92.LeftLeg = Part72
  621. Humanoid92.NameOcclusion = Enum.NameOcclusion.NoOcclusion
  622. Humanoid92.RightLeg = Part82
  623. Humanoid92.Torso = Part22
  624. remoteevent = Instance.new("RemoteEvent",char)
  625. remoteevent.Name = "SteveFunction"
  626. remoteevent.OnServerEvent:Connect(function(plr,a,b)
  627. necka = plr.Character.Torso.Neck
  628. necka.C0 = a
  629. necka.C1 = b
  630. end)
  631. NLS([[
  632. local sneaking = 0
  633. local ticks = 0
  634. local RS = game:GetService("RunService").RenderStepped
  635. local player = owner
  636. local bodyRot = CFrame.new(0, 0, 0)
  637. local mouse = player:GetMouse()
  638. mouse.KeyDown:Connect(function(key)
  639. if key == "q" then
  640. sneaking = 1
  641. end
  642. end)
  643. mouse.KeyUp:Connect(function(key)
  644. if key == "q" then
  645. sneaking = 0
  646. end
  647. end)
  648. char = player.Character
  649. local head = char:WaitForChild("Head")
  650. local remoteevent = char:WaitForChild("SteveFunction")
  651. remoteevent.Name = "SteveEvent"
  652. local torso = char:WaitForChild("Torso")
  653. local humanoid = char:WaitForChild("Humanoid")
  654. humanoid.AutoRotate = false
  655. neck = torso:WaitForChild("Neck")
  656. local humRootPart = char:WaitForChild("HumanoidRootPart")
  657. camera = workspace.CurrentCamera
  658. local camPart = Instance.new("Part", char)
  659. camPart.Size = Vector3.new(0, 0, 0)
  660. camPart.CFrame = camera.CFrame
  661. camPart.CanCollide = false
  662. camPart.Anchored = true
  663. camPart.Transparency = 1
  664. local lastCamRot = camPart.Orientation
  665. function AngleDifference(Angle1, Angle2)
  666. local Difference = {X = 0, Y = 0, Z = 0}
  667. Difference.X = Angle2.X - Angle1.X
  668.  
  669. if (Difference.X > 180) then
  670. Difference.X = Difference.X - 360
  671. elseif (Difference.X < -180) then
  672. Difference.X = Difference.X + 360
  673. end
  674.  
  675. Difference.Y = Angle2.Y - Angle1.Y
  676.  
  677. if (Difference.Y > 180) then
  678. Difference.Y = Difference.Y - 360
  679. elseif (Difference.Y < -180) then
  680. Difference.Y = Difference.Y + 360
  681. end
  682.  
  683. Difference.Z = Angle2.Z - Angle1.Z
  684.  
  685. if (Difference.Z > 180) then
  686. Difference.Z = Difference.Z - 360
  687. elseif (Difference.Z < -180) then
  688. Difference.Z = Difference.Z + 360
  689. end
  690.  
  691. return Vector3.new(Difference.X, Difference.Y, Difference.Z)
  692. end
  693. game:GetService("RunService").RenderStepped:Connect(function()
  694. if char:FindFirstChild("MobileCrouching") then
  695. sneaking = 1
  696. else
  697. sneaking = 0
  698. end
  699. local remoteevent = char:WaitForChild("SteveEvent")
  700. camPart.CFrame = camera.CFrame
  701. local neckYRot = math.rad(camPart.Orientation.Y - torso.Orientation.Y)
  702. local rotX = math.deg(math.atan2(humanoid.MoveDirection.Z, humanoid.MoveDirection.X)) + 90
  703. if humanoid.MoveDirection ~= Vector3.new(0, 0, 0) then
  704. --print(rotX)
  705. bodyRot = bodyRot:lerp(CFrame.Angles(0, -math.rad(rotX), 0), 0.125)
  706. humRootPart.CFrame = CFrame.new(humRootPart.CFrame.p.X, humRootPart.CFrame.p.Y, humRootPart.CFrame.p.Z) * bodyRot
  707. end
  708. local neckYRot = math.rad(camPart.Orientation.Y - torso.Orientation.Y)
  709. local YOffset = neck.C0.Y
  710.  
  711. local CFNew, CFAng = CFrame.new, CFrame.Angles
  712. local asin = math.asin
  713. local CameraDirection = owner.Character.HumanoidRootPart.CFrame:toObjectSpace(camera.CFrame).lookVector
  714. neck.C0 = CFNew(0, YOffset, 0) * CFAng(3 * math.pi/2, 0, math.pi) * CFAng(0, 0, -asin(CameraDirection.x)) * CFAng(-asin(CameraDirection.y), 0, 0)
  715. if owner.Character:WaitForChild("SteveEvent") then
  716. owner.Character.SteveEvent:FireServer (neck.C0,neck.C1)
  717. end
  718. end)
  719. ]], char)
  720. function waitForChild(parent, childName)
  721. local child = parent:findFirstChild(childName)
  722. if child then return child end
  723. while true do
  724. child = parent.ChildAdded:wait()
  725. if child.Name==childName then return child end
  726. end
  727. end
  728.  
  729. -- ANIMATION
  730.  
  731. -- declarations
  732.  
  733. local Figure = char
  734. local Torso = waitForChild(Figure, "Torso")
  735. local RightShoulder = waitForChild(Torso, "Right Shoulder")
  736. local LeftShoulder = waitForChild(Torso, "Left Shoulder")
  737. local RightHip = waitForChild(Torso, "Right Hip")
  738. local LeftHip = waitForChild(Torso, "Left Hip")
  739. local Neck = waitForChild(Torso, "Neck")
  740. local Humanoid = waitForChild(Figure, "Humanoid")
  741. local pose = "Standing"
  742. coroutine.resume(coroutine.create(function()
  743. while true do
  744. for i,v in pairs(char.Animate:GetChildren()) do
  745. for i,animation in pairs(v:GetChildren()) do
  746. animation.AnimationId = "rbxassetid://0"
  747. dooo = char.Humanoid:LoadAnimation(animation)
  748. dooo:Stop()
  749. end
  750. end
  751. wait(0.0001)
  752. end
  753. end))
  754. -- animations --
  755. Delay(0, function() --Vanilla Sound
  756. function waitForChild(parent, childName)
  757. local child = parent:findFirstChild(childName)
  758. if child then return child end
  759. while true do
  760. child = parent.ChildAdded:wait()
  761. if child.Name==childName then return child end
  762. end
  763. end
  764. function newSound(id)
  765. local sound = Instance.new("Sound")
  766. sound.SoundId = id
  767. sound.archivable = false
  768. sound.Parent = char.Head
  769. return sound
  770. end
  771. local sDied = newSound("rbxasset://sounds/uuhhh.wav")
  772. local sFallingDown = newSound("rbxasset://sounds/splat.wav")
  773. local sFreeFalling = newSound("rbxasset://sounds/swoosh.wav")
  774. local sGettingUp = newSound("rbxasset://sounds/hit.wav")
  775. local sJumping = newSound("rbxasset://sounds/button.wav")
  776. local sRunning = newSound("rbxasset://sounds/bfsl-minifigfoots1.mp3")
  777. sRunning.Looped = true
  778. local Figure = char
  779. local Head = waitForChild(Figure, "Head")
  780. local Humanoid = waitForChild(Figure, "Humanoid")
  781. function onDied()
  782. sDied:Play()
  783. end
  784. function onState(state, sound)
  785. if state then
  786. sound:Play()
  787. else
  788. sound:Pause()
  789. end
  790. end
  791. function onRunning(speed)
  792. if speed>0 then
  793. sRunning:Play()
  794. else
  795. sRunning:Pause()
  796. end
  797. end
  798. Humanoid.Died:connect(onDied)
  799. Humanoid.Running:connect(onRunning)
  800. Humanoid.Jumping:connect(function(state) onState(state, sJumping) end)
  801. Humanoid.GettingUp:connect(function(state) onState(state, sGettingUp) end)
  802. Humanoid.FreeFalling:connect(function(state) onState(state, sFreeFalling) end)
  803. Humanoid.FallingDown:connect(function(state) onState(state, sFallingDown) end)
  804. end)
  805. Delay(0, function() --Vanilla Health
  806. function waitForChild(parent, childName)
  807. local child = parent:findFirstChild(childName)
  808. if child then return child end
  809. while true do
  810. child = parent.ChildAdded:wait()
  811. if child.Name==childName then return child end
  812. end
  813. end
  814. local Figure = char
  815. local Humanoid = waitForChild(Figure, "Humanoid")
  816. local regening = false
  817. function regenHealth()
  818. if regening then return end
  819. regening = true
  820. while Humanoid.Health < Humanoid.MaxHealth do
  821. local s = wait(1)
  822. local health = Humanoid.Health
  823. if health > 0 and health < Humanoid.MaxHealth then
  824. local newHealthDelta = 0.01 * s * Humanoid.MaxHealth
  825. health = health + newHealthDelta
  826. Humanoid.Health = math.min(health,Humanoid.MaxHealth)
  827. end
  828. end
  829. if Humanoid.Health > Humanoid.MaxHealth then
  830. Humanoid.Health = Humanoid.MaxHealth
  831. end
  832. regening = false
  833. end
  834. Humanoid.HealthChanged:connect(regenHealth)
  835. end)
  836. Delay(0, function() --Vanilla Animate, Multiple Additions
  837. function waitForChild(parent, childName)
  838. local child = parent:findFirstChild(childName)
  839. if child then return child end
  840. while true do
  841. child = parent.ChildAdded:wait()
  842. if child.Name==childName then return child end
  843. end
  844. end
  845. local Figure = char
  846. --local Clone = Figure:Clone()
  847. local Torso = waitForChild(Figure, "Torso")
  848. local Joints = Torso:GetChildren()
  849. for All = 1, #Joints do
  850. if Joints.className == "Motor" or Joints.className == "Motor6D" then
  851. Joints[All]:Remove()
  852. end
  853. end
  854. local RightShoulder = Instance.new("Motor")
  855. local LeftShoulder = Instance.new("Motor")
  856. local RightHip = Instance.new("Motor")
  857. local LeftHip = Instance.new("Motor")
  858. local Neck = Instance.new("Motor")
  859. local Humanoid = waitForChild(Figure, "Humanoid")
  860. ZStat = 1
  861. ZStat2 = 0
  862. local pose = "Standing"
  863. RightShoulder.Part0 = Torso
  864. RightShoulder.Part1 = Figure["Right Arm"]
  865. RightShoulder.MaxVelocity = 0.15
  866. RightShoulder.Name = "Right Shoulder"
  867. RightShoulder.C0 = CFrame.new(1, 0.5, 0, 0, 0, 1, 0, 1, 0, -1, -0, -0)
  868. RightShoulder.C1 = CFrame.new(-0.5, 0.5, 0, 0, 0, 1, 0, 1, 0, -1, -0, -0)
  869. RightShoulder.Parent = Torso
  870. LeftShoulder.Part0 = Torso
  871. LeftShoulder.Part1 = Figure["Left Arm"]
  872. LeftShoulder.MaxVelocity = 0.15
  873. LeftShoulder.Name = "Left Shoulder"
  874. LeftShoulder.C0 = CFrame.new(-1, 0.5, 0, -0, -0, -1, 0, 1, 0, 1, 0, 0)
  875. LeftShoulder.C1 = CFrame.new(0.5, 0.5, 0, -0, -0, -1, 0, 1, 0, 1, 0, 0)
  876. LeftShoulder.Parent = Torso
  877. RightHip.Part0 = Torso
  878. RightHip.Part1 = Figure["Right Leg"]
  879. RightHip.MaxVelocity = 0.1
  880. RightHip.Name = "Right Hip"
  881. RightHip.C0 = CFrame.new(1, -1, 0, 0, 0, 1, 0, 1, 0, -1, -0, -0)
  882. RightHip.C1 = CFrame.new(0.5, 1, 0, 0, 0, 1, 0, 1, 0, -1, -0, -0)
  883. RightHip.Parent = Torso
  884. LeftHip.Part0 = Torso
  885. LeftHip.Part1 = Figure["Left Leg"]
  886. LeftHip.MaxVelocity = 0.1
  887. LeftHip.Name = "Left Hip"
  888. LeftHip.C0 = CFrame.new(-1, -1, 0, -0, -0, -1, 0, 1, 0, 1, 0, 0)
  889. LeftHip.C1 = CFrame.new(-0.5, 1, 0, -0, -0, -1, 0, 1, 0, 1, 0, 0)
  890. LeftHip.Parent = Torso
  891. Neck.Part0 = Torso
  892. Neck.Part1 = Figure["Head"]
  893. Neck.MaxVelocity = 0.1
  894. Neck.Name = "Neck"
  895. Neck.C0 = CFrame.new(0, 1, 0, -1, -0, -0, 0, 0, 1, 0, 1, 0)
  896. Neck.C1 = CFrame.new(0, -0.5, 0, -1, -0, -0, 0, 0, 1, 0, 1, 0)
  897. Neck.Parent = Torso
  898. local toolAnim = "None"
  899. local toolAnimTime = 0
  900. SpawnModel = Instance.new("Model")
  901. function onRunning(speed)
  902. if speed>0 then
  903. pose = "Running"
  904. else
  905. pose = "Standing"
  906. end
  907. end
  908. function CheckTag(Tag)
  909. if char:FindFirstChild("IsLocalEnemy") == nil and char:FindFirstChild("IsAZombie") == nil and Tag.ClassName == "ObjectValue" and Tag.Value ~= nil and Tag.Value.ClassName == "Player" and Tag.Value.Character ~= nil then
  910. if Tag.Value.Character:FindFirstChild("IsLocalEnemy") == nil then
  911. if (char.IsOnTeam.Value == true and IsInCombat == false and char.IsOnTeam.Team.Value == Tag.Value.TeamColor) or char.IsOnTeam.Value == false then
  912. local Tag2 = Instance.new("CFrameValue", Tag.Value.Character)
  913. Tag2.Name = "IsLocalEnemy"
  914. print(Tag.Value.Character.Name .." Has Become An Outlaw")
  915. end
  916. end
  917. if Tag.Value.Character:FindFirstChild("Loc" ..char.Name) ~= nil then
  918. Tag.Value.Character:FindFirstChild("Loc" ..char.Name):Remove()
  919. end
  920. local Found = Instance.new("CFrameValue", Tag.Value.Character)
  921. Found.Name = "Loc" ..char.Name
  922. game:GetService("Debris"):AddItem(Found, 3)
  923. elseif char:FindFirstChild("IsLocalEnemy") == nil and char:FindFirstChild("IsAZombie") == nil and Tag.ClassName == "StringValue" and game.Players:FindFirstChild(Tag.Value) ~= nil and game.Players[Tag.Value].Character ~= nil then
  924. if game.Players[Tag.Value].Character:FindFirstChild("IsLocalEnemy") == nil then
  925. if (char.IsOnTeam.Value == true and IsInCombat == false and char.IsOnTeam.Team.Value == game.Players[Tag.Value].TeamColor) or char.IsOnTeam.Value == false then
  926. local Tag2 = Instance.new("CFrameValue", game.Players[Tag.Value].Character)
  927. Tag2.Name = "IsLocalEnemy"
  928. print(Tag.Value .." Has Become An Outlaw")
  929. end
  930. end
  931. if game.Players[Tag.Value].Character:FindFirstChild("Loc" ..char.Name) ~= nil then
  932. game.Players[Tag.Value].Character:FindFirstChild("Loc" ..char.Name):Remove()
  933. end
  934. local Found = Instance.new("CFrameValue", game.Players[Tag.Value].Character)
  935. Found.Name = "Loc" ..char.Name
  936. game:GetService("Debris"):AddItem(Found, 3)
  937. elseif char:FindFirstChild("IsLocalEnemy") == nil and char:FindFirstChild("IsAZombie") == nil and Tag.ClassName == "StringValue" and game.Workspace:FindFirstChild(Tag.Value) ~= nil then
  938. if game.Workspace[Tag.Value]:FindFirstChild("IsLocalEnemy") == nil then
  939. if (char.IsOnTeam.Value == true and IsInCombat == false and Workspace[Tag.Value].IsOnTeam.Value == true and char.IsOnTeam.Team.Value == Workspace[Tag.Value].IsOnTeam.Team.Value) or char.IsOnTeam.Value == false or Workspace[Tag.Value].IsOnTeam.Value == false then
  940. local Tag2 = Instance.new("CFrameValue", game.Workspace[Tag.Value])
  941. Tag2.Name = "IsLocalEnemy"
  942. print(Tag.Value .." Has Become An Outlaw")
  943. end
  944. end
  945. if game.Workspace[Tag.Value]:FindFirstChild("Loc" ..char.Name) ~= nil then
  946. game.Workspace[Tag.Value]:FindFirstChild("Loc" ..char.Name):Remove()
  947. end
  948. local Found = Instance.new("CFrameValue", game.Workspace[Tag.Value])
  949. Found.Name = "Loc" ..char.Name
  950. game:GetService("Debris"):AddItem(Found, 3)
  951. elseif (char:FindFirstChild("IsLocalEnemy") ~= nil or char:FindFirstChild("IsAZombie") ~= nil) and Tag.ClassName == "ObjectValue" and Tag.Value ~= nil and Tag.Value.ClassName == "Player" and Tag.Value.Character ~= nil then
  952. local Found = Instance.new("CFrameValue", Tag.Value.Character)
  953. Found.Name = "Loc" ..char.Name
  954. game:GetService("Debris"):AddItem(Found, 3)
  955. elseif (char:FindFirstChild("IsLocalEnemy") ~= nil or char:FindFirstChild("IsAZombie") ~= nil) and Tag.ClassName == "StringValue" and game.Workspace:FindFirstChild(Tag.Value) ~= nil then
  956. local Found = Instance.new("CFrameValue", game.Workspace[Tag.Value])
  957. Found.Name = "Loc" ..char.Name
  958. game:GetService("Debris"):AddItem(Found, 3)
  959. end
  960. end
  961. function CheckSpawns(Object)
  962. local Parts = Object:GetChildren()
  963. for Check = 1, #Parts do
  964. if Parts[Check].className == "SpawnLocation" then
  965. local I = Instance.new("Vector3Value", SpawnModel)
  966. I.Value = Parts[Check].Position
  967. end
  968. CheckSpawns(Parts[Check])
  969. end
  970. end
  971. function onDied()
  972. pose = "Dead"
  973. Delay(5, function()
  974. if char.Respawn.Value == true then
  975. CheckSpawns(Workspace)
  976. local Spawn = SpawnModel:GetChildren()
  977. --Clone.Parent = game.Workspace
  978. if #Spawn > 0 then
  979. Spawn = Spawn[math.random(1, #Spawn)].Value
  980. --Clone:MoveTo(Spawn)
  981. else
  982. --Clone:MoveTo(Vector3.new(0, 50, 0))
  983. end
  984. end
  985. Figure:Remove()
  986. return
  987. end)
  988. end
  989. function onJumping()
  990. pose = "Jumping"
  991. end
  992. function onClimbing()
  993. pose = "Climbing"
  994. end
  995. function onGettingUp()
  996. pose = "GettingUp"
  997. end
  998. function onFreeFall()
  999. pose = "FreeFall"
  1000. end
  1001. function onFallingDown()
  1002. pose = "FallingDown"
  1003. end
  1004. function onSeated()
  1005. pose = "Seated"
  1006. end
  1007. function onPlatformStanding()
  1008. pose = "PlatformStanding"
  1009. end
  1010. function moveJump()
  1011. RightShoulder.MaxVelocity = 0.5
  1012. LeftShoulder.MaxVelocity = 0.5
  1013. RightShoulder.DesiredAngle = (3.14/ZStat)
  1014. LeftShoulder.DesiredAngle = (-3.14/ZStat)
  1015. RightHip.DesiredAngle = (0)
  1016. LeftHip.DesiredAngle = (0)
  1017. end
  1018. function moveFreeFall()
  1019. RightShoulder.MaxVelocity = 0.5
  1020. LeftShoulder.MaxVelocity = 0.5
  1021. RightShoulder.DesiredAngle = (3.14/ZStat)
  1022. LeftShoulder.DesiredAngle = (-3.14/ZStat)
  1023. RightHip.DesiredAngle = (0)
  1024. LeftHip.DesiredAngle = (0)
  1025. end
  1026. function moveSit()
  1027. RightShoulder.MaxVelocity = 0.15
  1028. LeftShoulder.MaxVelocity = 0.15
  1029. RightShoulder.DesiredAngle = (3.14 /2)
  1030. LeftShoulder.DesiredAngle = (-3.14 /2)
  1031. RightHip.DesiredAngle = (3.14 /2)
  1032. LeftHip.DesiredAngle = (-3.14 /2)
  1033. end
  1034. function getTool()
  1035. for _, kid in ipairs(Figure:GetChildren()) do
  1036. if kid.className == "Tool" then return kid end
  1037. end
  1038. return nil
  1039. end
  1040. function getToolAnim(tool)
  1041. for _, c in ipairs(tool:GetChildren()) do
  1042. if c.Name == "toolanim" and c.className == "StringValue" then
  1043. return c
  1044. end
  1045. end
  1046. return nil
  1047. end
  1048. function animateTool()
  1049. if (toolAnim == "None") then
  1050. RightShoulder.DesiredAngle = (1.57)
  1051. return
  1052. end
  1053. if (toolAnim == "Slash") then
  1054. RightShoulder.MaxVelocity = 0.5
  1055. RightShoulder.DesiredAngle = (0)
  1056. return
  1057. end
  1058. if (toolAnim == "Lunge") then
  1059. RightShoulder.MaxVelocity = 0.5
  1060. LeftShoulder.MaxVelocity = 0.5
  1061. RightHip.MaxVelocity = 0.5
  1062. LeftHip.MaxVelocity = 0.5
  1063. RightShoulder.DesiredAngle = (1.57)
  1064. LeftShoulder.DesiredAngle = (1.0)
  1065. RightHip.DesiredAngle = (1.57)
  1066. LeftHip.DesiredAngle = (1.0)
  1067. return
  1068. end
  1069. end
  1070. function move(time)
  1071. local amplitude
  1072. local frequency
  1073. if (pose == "Jumping") then
  1074. moveJump()
  1075. return
  1076. end
  1077. if (pose == "FreeFall") then
  1078. moveFreeFall()
  1079. return
  1080. end
  1081. if (pose == "Seated") then
  1082. moveSit()
  1083. return
  1084. end
  1085. local climbFudge = 0
  1086. if (pose == "Running") then
  1087. RightShoulder.MaxVelocity = 0.15
  1088. LeftShoulder.MaxVelocity = 0.15
  1089. amplitude = 1
  1090. frequency = 9
  1091. elseif (pose == "Climbing") then
  1092. RightShoulder.MaxVelocity = 0.5
  1093. LeftShoulder.MaxVelocity = 0.5
  1094. amplitude = 1
  1095. frequency = 9
  1096. climbFudge = 3.14
  1097. else
  1098. amplitude = 0.1
  1099. frequency = 1
  1100. end
  1101. desiredAngle = amplitude * math.sin(time*frequency)
  1102. RightShoulder.DesiredAngle = (desiredAngle + climbFudge) + ZStat2
  1103. LeftShoulder.DesiredAngle = (desiredAngle - climbFudge) -ZStat2
  1104. RightHip.DesiredAngle = (-desiredAngle)
  1105. LeftHip.DesiredAngle = (-desiredAngle)
  1106. local tool = getTool()
  1107. if tool then
  1108. animStringValueObject = getToolAnim(tool)
  1109. if animStringValueObject then
  1110. toolAnim = animStringValueObject.Value
  1111. animStringValueObject.Parent = nil
  1112. toolAnimTime = time + .3
  1113. end
  1114. if time > toolAnimTime then
  1115. toolAnimTime = 0
  1116. toolAnim = "None"
  1117. end
  1118. animateTool()
  1119. else
  1120. toolAnim = "None"
  1121. toolAnimTime = 0
  1122. end
  1123. end
  1124. Humanoid.Died:connect(onDied)
  1125. Humanoid.Running:connect(onRunning)
  1126. Humanoid.Jumping:connect(onJumping)
  1127. Humanoid.Climbing:connect(onClimbing)
  1128. Humanoid.GettingUp:connect(onGettingUp)
  1129. Humanoid.FreeFalling:connect(onFreeFall)
  1130. Humanoid.FallingDown:connect(onFallingDown)
  1131. Humanoid.Seated:connect(onSeated)
  1132. Humanoid.PlatformStanding:connect(onPlatformStanding)
  1133. Humanoid.ChildAdded:connect(CheckTag)
  1134. OriginalTime = 0.1
  1135. Time = OriginalTime
  1136. while Figure.Parent~=nil do
  1137. Time = Time + 0.1
  1138. wait(OriginalTime)
  1139. move(Time)
  1140. end
  1141. end)
  1142. Delay(0, function() --lah30303's Pathing Script
  1143. function CalcMoves(map, px, py, tx, ty)
  1144. if map[ty][tx] ~= 0 then
  1145. return nil
  1146. end
  1147. local openlist, closedlist, listk, closedk, tempH, tempG, xsize, ysize, curbase = {}, {}, 1, 0, math.abs(px - tx) + math.abs(py - ty), 0, #map[1], #map, {}
  1148. openlist[1] = {x = px, y = py, g = 0, h = tempH, f = 0 + tempH ,par = 1}
  1149. local nodenumber = 0
  1150. while listk > 0 do
  1151. nodenumber = nodenumber + 1
  1152. if nodenumber / ScanSkip == math.floor(nodenumber / ScanSkip) then
  1153. wait()
  1154. if DebugPathing == true then
  1155. print("Node", nodenumber)
  1156. end
  1157. end
  1158. closedk = closedk + 1
  1159. table.insert(closedlist, closedk, openlist[1])
  1160. curbase = closedlist[closedk]
  1161. if closedlist[closedk].x == tx and closedlist[closedk].y == ty then
  1162. return closedlist
  1163. end
  1164. openlist[1] = openlist[listk]
  1165. table.remove(openlist, listk)
  1166. listk = listk - 1
  1167. local v = 1
  1168. while true do
  1169. local u = v
  1170. if 2 * u + 1 <= listk then
  1171. if openlist[u].f >= openlist[2 * u].f then
  1172. v = 2 * u
  1173. end
  1174. if openlist[v].f >= openlist[2 * u + 1].f then
  1175. v = 2 * u + 1
  1176. end
  1177. elseif 2 * u <= listk then
  1178. if openlist[u].f >= openlist[2 * u].f then
  1179. v = 2 * u
  1180. end
  1181. end
  1182. if u ~= v then
  1183. local temp = openlist[u]
  1184. openlist[u] = openlist[v]
  1185. openlist[v] = temp
  1186. else
  1187. break
  1188. end
  1189. end
  1190.  
  1191. local tocheck = {{1, 0}, {-1, 0}, {0, 1}, {0, -1}, {-1, -1}, {1, -1}, {-1, 1}, {1, 1}} --[1]Right, [2]Left, [3]Down, [4]Up, [5]UpLeft, [6]UpRight, [7]DownLeft, [8]DownRight
  1192. if closedk > 0 then
  1193. for k = 1, closedk do
  1194. for i, v in pairs(tocheck) do
  1195. if closedlist[k].x == curbase.x + v[1] and closedlist[k].y == curbase.y + v[2] then
  1196. tocheck[i] = nil
  1197. end
  1198. end
  1199. end
  1200. end
  1201. for i, v in pairs(tocheck) do
  1202. local a = curbase.x + v[1]
  1203. local b = curbase.y + v[2]
  1204. if a > xsize or a < 1 or b > ysize or b < 1 then
  1205. tocheck[i] = nil
  1206. end
  1207. end
  1208. for i, v in pairs(tocheck) do
  1209. local a, b = curbase.x + v[1], curbase.y + v[2]
  1210. if a <= xsize and a >= 1 and b <= ysize and b >= 1 and map[b][a] ~= 0 then
  1211. tocheck[i] = nil
  1212. end
  1213. end
  1214. tempG = curbase.g + 1
  1215. tempDiagG = curbase.g + 1.4
  1216. for k = 1, listk do
  1217. for i, v in pairs(tocheck) do
  1218. if openlist[k].x == curbase.x + v[1] and openlist[k].y == curbase.y + 1 and openlist[k].g > tempG then
  1219. tempH = math.abs((curbase.x + v[1])-tx) + math.abs((curbase.y + v[1])-ty)
  1220. table.insert(openlist, k, {x = curbase.x + v[1], y = curbase.y + v[2], g = tempG, h = tempH, f = tempG + tempH, par = closedk})
  1221. local m = k
  1222. while m ~= 1 do
  1223. if openlist[m].f <= openlist[math.floor(m/2)].f then
  1224. temp = openlist[math.floor(m/2)]
  1225. openlist[math.floor(m/2)] = openlist[m]
  1226. openlist[m] = temp
  1227. m = math.floor(m/2)
  1228. else
  1229. break
  1230. end
  1231. tocheck[i] = nil
  1232. end
  1233. end
  1234. end
  1235. end
  1236. for i, v in pairs(tocheck) do
  1237. listk = listk + 1
  1238. tempH = math.abs((curbase.x + v[1]) - tx) + math.abs((curbase.y + v[2]) - ty)
  1239. table.insert(openlist, listk, {x = curbase.x + v[1], y = curbase.y + v[2], g = tempG, h = tempH, f = tempG+tempH, par = closedk})
  1240. m = listk
  1241. while m ~= 1 do
  1242. if openlist[m].f <= openlist[math.floor(m/2)].f then
  1243. temp = openlist[math.floor(m/2)]
  1244. openlist[math.floor(m/2)] = openlist[m]
  1245. openlist[m] = temp
  1246. m = math.floor(m/2)
  1247. else
  1248. break
  1249. end
  1250. end
  1251. end
  1252. end
  1253. return nil
  1254. end
  1255.  
  1256.  
  1257. function CalcPath(closedlist)
  1258.  
  1259. if closedlist == nil or table.getn(closedlist) == 1 then
  1260. return nil
  1261. end
  1262. local path = {}
  1263. local pathIndex = {}
  1264. local last = table.getn(closedlist)
  1265. table.insert(pathIndex,1,last)
  1266.  
  1267. local i = 1
  1268. while pathIndex[i] > 1 do
  1269. i = i + 1
  1270. table.insert(pathIndex, i, closedlist[pathIndex[i - 1]].par)
  1271. end
  1272.  
  1273. for n = table.getn(pathIndex) - 1, 1, -1 do
  1274. table.insert(path, {x = closedlist[pathIndex[n]].x, y = closedlist[pathIndex[n]].y})
  1275. end
  1276.  
  1277. closedlist = nil
  1278. return path
  1279. end
  1280. end)
  1281. Delay(0, function() --Main Artificial Intelligence Scripting/Path Grid Generator
  1282. local Base
  1283. if char:FindFirstChild("BASE") == nil then
  1284. Base = Instance.new("Part")
  1285. Base.Transparency = 1
  1286. Base.TopSurface = "Smooth"
  1287. Base.BottomSurface = "Smooth"
  1288. Base.CanCollide = false
  1289. Base.Anchored = true
  1290. Base.Locked = true
  1291. Base.BrickColor = BrickColor.new(0, 0, 0)
  1292. Base.Name = "BASE"
  1293. Base.CFrame = CFrame.new(Vector3.new(0, 0, 0))
  1294. Base.Parent = char
  1295. else
  1296. Base = char.BASE
  1297. Base.CFrame = CFrame.new(Vector3.new(0, 0, 0))
  1298. end
  1299. function Jump()
  1300. --char.Humanoid.Jump = true
  1301. end
  1302. function Check(Hit)
  1303. if Hit ~= nil and Hit.Parent ~= nil and Hit.Parent.Parent ~= nil then
  1304. if Hit.Parent:FindFirstChild("Humanoid") == nil and Hit.Parent.Parent:FindFirstChild("Humanoid") == nil then
  1305. Jump()
  1306. end
  1307. end
  1308. end
  1309. char.Torso.Touched:connect(Check)
  1310. function Prep(Target, Current, Attempts)
  1311. if Attempts == nil then
  1312. Attempts = 1000
  1313. end
  1314. local Hit = false
  1315. local Tag = Base:Clone()
  1316. Tag.Position = Target
  1317. Tag.Parent = char
  1318. local TagRay = Ray.new(Tag.CFrame.p, (CFrame.new(Tag.CFrame.p - Vector3.new(0, 3, 0)).p - Tag.CFrame.p).Unit * 40)
  1319. local TRHit, TRPos = game.Workspace:FindPartOnRay(TagRay, char)
  1320. if TRHit ~= nil then
  1321. Hit = true
  1322. end
  1323. if Tag.Parent ~= nil then
  1324. Tag:Remove()
  1325. end
  1326. if Hit == false and Attempts > 0 and char.Wander.Value == true then
  1327. Prep(char.Torso.Position + Vector3.new(math.random(-100, 100), 0, math.random(-100, 100)), Base, Attempts - 1)
  1328. elseif char.Wander.Value == true then
  1329. local TargetRay = Ray.new(char.Torso.CFrame.p, (CFrame.new(Target).p - char.Torso.CFrame.p).Unit * ((Target - char.Torso.Position).Magnitude - 3))
  1330. local THit, TPos = game.Workspace:FindPartOnRay(TargetRay, char)
  1331. local TrueTarget = char.Torso.Position
  1332. if THit ~= nil then
  1333. for HazardCheck = 1, math.floor((char.Torso.CFrame.p - TPos).Magnitude) do
  1334. local TR2 = Ray.new(char.Torso.CFrame.p + (TPos - char.Torso.CFrame.p).Unit * HazardCheck, Vector3.new(0, -50, 0) + (TPos - char.Torso.CFrame.p).Unit * 3)
  1335. local TH2, TP2 = game.Workspace:FindPartOnRay(TR2, char)
  1336. if TH2 ~= nil and TH2.Name ~= "Lava" then
  1337. TrueTarget = TP2
  1338. else
  1339. break
  1340. end
  1341. end
  1342. else
  1343. for HazardCheck = 1, math.floor((char.Torso.CFrame.p - Target).Magnitude) do
  1344. local TR2 = Ray.new(char.Torso.CFrame.p + (Target - char.Torso.CFrame.p).Unit * HazardCheck, Vector3.new(0, -50, 0) + (TPos - char.Torso.CFrame.p).Unit * 3)
  1345. local TH2, TP2 = game.Workspace:FindPartOnRay(TR2, char)
  1346. if TH2 ~= nil and TH2.Name ~= "Lava" then
  1347. TrueTarget = TP2
  1348. else
  1349. break
  1350. end
  1351. end
  1352. end
  1353. --char.Humanoid:MoveTo(TrueTarget, Current)
  1354. end
  1355. end
  1356. function ZHit(Part)
  1357. if char:FindFirstChild("IsAZombie") ~= nil and char.Humanoid.Health > 0 and Part ~= nil and Part.Parent ~= nil and Part.Parent:FindFirstChild("Humanoid") ~= nil and Part.Parent:FindFirstChild("IsAZombie") == nil then
  1358. Part.Parent.Humanoid:TakeDamage(2)
  1359. char.Humanoid.MaxHealth = char.Humanoid.MaxHealth + 1
  1360. char.Humanoid:TakeDamage(-1)
  1361. end
  1362. end
  1363. char["Right Arm"].Touched:connect(ZHit)
  1364. char["Left Arm"].Touched:connect(ZHit)
  1365. CurrentMap = {}
  1366. MapMask = {}
  1367. MapVar = {0, 0, 0, 0, 0}
  1368. BlockScanned = 0
  1369. ScanSkip = 5
  1370. DebugPathing = true
  1371. function GenerateMap(PathPos)
  1372. CurrentMap = {}
  1373. MapMask = {}
  1374. MapVar = {0, 0, 0, 0, 0}
  1375. BlockScanned = 0
  1376. MapVariables = ScanParts(Workspace, 1)
  1377. for MapX = 1, math.max(-MapVariables[1], MapVariables[2]) * 2 + 1 do
  1378. CurrentMap[MapX] = {}
  1379. for MapY = 1, math.max(-MapVariables[3], MapVariables[4]) * 2 + 1 do
  1380. CurrentMap[MapX][MapY] = 0
  1381. end
  1382. end
  1383. for MaskX = 1, #CurrentMap do
  1384. MapMask[MaskX] = {}
  1385. for MaskY = 1, #CurrentMap[MaskX] do
  1386. MapMask[MaskX][MaskY] = {MapVariables[1] + MaskX - 0.5, MapVariables[1] + MaskY - 0.5}
  1387. end
  1388. end
  1389. ScanParts(Workspace, 2, MapVariables)
  1390. wait(1)
  1391. if char.PrintMap.Value == true then
  1392. print("Printing Map...")
  1393. for ClearPrint = 1, 250 do
  1394. wait()
  1395. print()
  1396. end
  1397. for PrintX = 1, #CurrentMap do
  1398. local PrintZ = ""
  1399. for PrintY = 1, #CurrentMap[PrintX] do
  1400. PrintZ = PrintZ ..CurrentMap[PrintX][PrintY]
  1401. end
  1402. print(PrintZ)
  1403. wait(0.1)
  1404. end
  1405. end
  1406. local MapCoords = {0, 0, 0, 0}
  1407. local Distance = math.huge
  1408. for MPX = 1, #CurrentMap do
  1409. for MPY = 1, #CurrentMap[MPX] do
  1410. if (Vector3.new(MapMask[MPX][MPY][1], 0, MapMask[MPX][MPY][2]) - Vector3.new(char.Torso.Position.X, 0, char.Torso.Position.Z)).Magnitude < Distance then
  1411. MapCoords = {MPX, MPY, 0, 0}
  1412. Distance = (Vector3.new(MapMask[MPX][MPY][1], 0, MapMask[MPX][MPY][2]) - Vector3.new(char.Torso.Position.X, 0, char.Torso.Position.Z)).Magnitude
  1413. end
  1414. end
  1415. end
  1416. local Distance = math.huge
  1417. for MPX = 1, #CurrentMap do
  1418. for MPY = 1, #CurrentMap[MPX] do
  1419. if (Vector3.new(MapMask[MPX][MPY][1], 0, MapMask[MPX][MPY][2]) - Vector3.new(char.PathTo.Value.X, 0, char.PathTo.Value.Z)).Magnitude < Distance then
  1420. MapCoords = {MapCoords[1], MapCoords[2], math.min(MPX, #CurrentMap) - 1, math.min(MPY, #CurrentMap[1] - 1)}
  1421. Distance = (Vector3.new(MapMask[MPX][MPY][1], 0, MapMask[MPX][MPY][2]) - Vector3.new(char.PathTo.Value.X, 0, char.PathTo.Value.Z)).Magnitude
  1422. end
  1423. end
  1424. end
  1425. for i, v in pairs(CalcPath(CalcMoves(CurrentMap, MapCoords[1], MapCoords[2], MapCoords[3], MapCoords[4]))) do
  1426. local Timer = 20
  1427. local pX = v["x"]
  1428. local pY = v["y"]
  1429. local pTo = Vector3.new(MapMask[pX][pY][1], 0, MapMask[pX][pY][2])
  1430. pTo = pTo + (pTo - Vector3.new(char.Torso.Position.X, 0, char.Torso.Position.Z)).Unit
  1431. while (Vector3.new(char.Torso.Position.X, 0, char.Torso.Position.Z) - pTo).Magnitude > 2.5 and Timer > 0 do
  1432. --char.Humanoid:MoveTo(pTo, Base)
  1433. Timer = Timer - 1
  1434. if Timer == 10 then
  1435. --char.Humanoid.Jump = true
  1436. end
  1437. wait(0.1)
  1438. end
  1439. if Timer == 0 then
  1440. if (Vector3.new(char.Torso.Position.X, 0, char.Torso.Position.Z) - pTo).Magnitude <= 5 then
  1441. char.Torso.CFrame = char.Torso.CFrame + (pTo - Vector3.new(char.Torso.Position.X, 0, char.Torso.Position.Z)).Unit * (pTo - Vector3.new(char.Torso.Position.X, 0, char.Torso.Position.Z)).Magnitude
  1442. else
  1443. break
  1444. end
  1445. end
  1446. end
  1447. end
  1448. function ScanParts(CurrentModel, CurrentStage, Variables)
  1449. local X = CurrentModel:GetChildren()
  1450. for I = 1, #X do
  1451. if #X[I]:GetChildren() > 0 then
  1452. ScanParts(X[I], 1, Variables)
  1453. end
  1454. if X[I].ClassName == "Part" or X[I].ClassName == "WedgePart" or X[I].ClassName == "CornerWedgePart" or X[I].ClassName == "TrussPart" or X[I].ClassName == "SpawnLocation" or X[I].ClassName == "Seat" or X[I].ClassName == "VehicleSeat" or X[I].ClassName == "SkateboardPlatform" then
  1455. BlockScanned = BlockScanned + 1
  1456. if BlockScanned / ScanSkip == math.floor(BlockScanned / ScanSkip) then
  1457. wait()
  1458. if DebugPathing == true then
  1459. print("Block", BlockScanned)
  1460. end
  1461. end
  1462. if CurrentStage == 1 then
  1463. MapVar[1] = math.min(math.ceil(X[I].Position.X - X[I].Size.X / 2), MapVar[1])
  1464. MapVar[2] = math.max(math.floor(X[I].Position.X + X[I].Size.X / 2), MapVar[2])
  1465. MapVar[3] = math.min(math.ceil(X[I].Position.Z - X[I].Size.Z / 2), MapVar[3])
  1466. MapVar[4] = math.max(math.floor(X[I].Position.Z + X[I].Size.Z / 2), MapVar[4])
  1467. elseif CurrentStage == 2 and ((X[I].Position.Y + X[I].Size.Y / 2 > char.Torso.Position.Y + 2 and X[I].Position.Y - X[I].Size.Y / 2 < char.Torso.Position.Y + 2) or X[I].Position.Y + X[I].Size.Y / 2 < char.Torso.Position.Y - 8) then
  1468. local BlockStart = {X[I].Position.X - X[I].Size.X / 2, X[I].Position.Z - X[I].Size.Z / 2}
  1469. local BlockEnd = {X[I].Position.X + X[I].Size.X / 2, X[I].Position.Z + X[I].Size.Z / 2}
  1470. local BlockCoords = {0, 0, 0, 0}
  1471. local Distance = math.huge
  1472. for MPX = 1, #CurrentMap do
  1473. for MPY = 1, #CurrentMap[MPX] do
  1474. if (Vector3.new(MapMask[MPX][MPY][1], 0, MapMask[MPX][MPY][2]) - Vector3.new(BlockStart[1], 0, BlockStart[2])).Magnitude < Distance then
  1475. BlockCoords = {MPX, MPY, 0, 0}
  1476. Distance = (Vector3.new(MapMask[MPX][MPY][1], 0, MapMask[MPX][MPY][2]) - Vector3.new(BlockStart[1], 0, BlockStart[2])).Magnitude
  1477. end
  1478. end
  1479. end
  1480. local Distance = math.huge
  1481. for MPX = 1, #CurrentMap do
  1482. for MPY = 1, #CurrentMap[MPX] do
  1483. if (Vector3.new(MapMask[MPX][MPY][1], 0, MapMask[MPX][MPY][2]) - Vector3.new(BlockEnd[1], 0, BlockEnd[2])).Magnitude < Distance then
  1484. BlockCoords = {BlockCoords[1], BlockCoords[2], MPX, MPY}
  1485. Distance = (Vector3.new(MapMask[MPX][MPY][1], 0, MapMask[MPX][MPY][2]) - Vector3.new(BlockEnd[1], 0, BlockEnd[2])).Magnitude
  1486. end
  1487. end
  1488. end
  1489. for XGrid = BlockCoords[2], BlockCoords[4] do
  1490. for YGrid = BlockCoords[1], BlockCoords[3] do
  1491. CurrentMap[XGrid][YGrid] = 1
  1492. end
  1493. end
  1494. end
  1495. end
  1496. end
  1497. if CurrentStage == 1 then
  1498. MapVar[5] = {MapVar[1] + MapVar[2] / 2, MapVar[3] + MapVar[4] / 2}
  1499. return MapVar
  1500. end
  1501. end
  1502. IsInCombat = false
  1503. while char.Humanoid.Health > 0 and char:FindFirstChild("IsAZombie") == nil do
  1504. local Distance = 100
  1505. local Target = nil
  1506. IsInCombat = false
  1507. local Players = Workspace:GetChildren()
  1508. for Check = 1, #Players do
  1509. if Players[Check] ~= char and ((Players[Check]:FindFirstChild("Humanoid") ~= nil and (Players[Check]:FindFirstChild("IsAZombie") ~= nil or Players[Check]:FindFirstChild("IsLocalEnemy") ~= nil or char:FindFirstChild("IsLocalEnemy") ~= nil or (char.IsOnTeam.Value == true and Players[Check]:FindFirstChild("IsOnTeam") ~= nil and Players[Check].IsOnTeam.Value == true and char.IsOnTeam.Team.Value ~= Players[Check].IsOnTeam.Team.Value) or (game.Players:GetPlayerFromCharacter(Players[Check]) ~= nil and char.IsOnTeam.Value == true and game.Players:GetPlayerFromCharacter(Players[Check]).Neutral == false and game.Players:GetPlayerFromCharacter(Players[Check]).TeamColor ~= char.IsOnTeam.Team.Value)) and Players[Check].Humanoid.Health > 0) or (Players[Check]:FindFirstChild("Zombie") ~= nil and Players[Check].Zombie.ClassName == "Humanoid" and Players[Check].Zombie.Health > 0)) and Players[Check]:FindFirstChild("Torso") ~= nil and (Players[Check].Torso.Position - char.Torso.Position).Magnitude <= 100 then
  1510. local Ray = Ray.new(char.Torso.CFrame.p, (Players[Check].Torso.CFrame.p - char.Torso.CFrame.p).Unit * 100)
  1511. local Hit, Position = game.Workspace:FindPartOnRay(Ray, char)
  1512. if Hit ~= nil and Hit.Parent ~= nil and ((Hit.Parent:FindFirstChild("Humanoid") ~= nil and Hit.Parent == Players[Check]) or (Hit.Parent.Parent ~= nil and Hit.Parent.Parent:FindFirstChild("Humanoid") ~= nil and Hit.Parent.Parent == Players[Check])) then
  1513. local TeamTag = nil
  1514. local Parts = Players[Check]:GetChildren()
  1515. for X = 1, #Parts do
  1516. if Parts[X].Name == "TeamLoc" then
  1517. if Parts[X].Value == char.IsOnTeam.Team.Value then
  1518. TeamTag = Parts[X]
  1519. end
  1520. end
  1521. end
  1522. if Players[Check]:FindFirstChild("Loc" ..char.Name) ~= nil or Parts[X] ~= nil or (Players[Check].Torso.Position - (char.Torso.Position + char.Torso.CFrame.lookVector * 50)).Magnitude <= 52 then
  1523. if char.IsOnTeam.Value == false then
  1524. if Players[Check]:FindFirstChild("Loc" ..char.Name) ~= nil then
  1525. Players[Check]:FindFirstChild("Loc" ..char.Name):Remove()
  1526. end
  1527. local Found = Instance.new("CFrameValue", Players[Check])
  1528. Found.Name = "Loc" ..char.Name
  1529. game:GetService("Debris"):AddItem(Found, 3)
  1530. else
  1531. if Parts[X] ~= nil then
  1532. Parts[X]:Remove()
  1533. end
  1534. local Found = Instance.new("BrickColorValue", Players[Check])
  1535. Found.Name = "TeamLoc"
  1536. Found.Value = char.IsOnTeam.Team.Value
  1537. game:GetService("Debris"):AddItem(Found, 3)
  1538. if Players[Check]:FindFirstChild("Loc" ..char.Name) ~= nil then
  1539. Players[Check]:FindFirstChild("Loc" ..char.Name):Remove()
  1540. end
  1541. local Found = Instance.new("CFrameValue", Players[Check])
  1542. Found.Name = "Loc" ..char.Name
  1543. game:GetService("Debris"):AddItem(Found, 3)
  1544. end
  1545. end
  1546. if Players[Check]:FindFirstChild("Loc" ..char.Name) ~= nil and (Players[Check].Torso.Position - char.Torso.Position).Magnitude <= Distance then
  1547. Target = Players[Check].Torso
  1548. Distance = (Target.Position - char.Torso.Position).Magnitude
  1549. end
  1550. end
  1551. end
  1552. end
  1553. if Target == nil then
  1554. local HasTool = false
  1555. local ToolCheck = char:GetChildren()
  1556. for Check = 1, #ToolCheck do
  1557. if ToolCheck[Check].ClassName == "Tool" then
  1558. HasTool = true
  1559. end
  1560. end
  1561. if HasTool == false then
  1562. Distance = 100
  1563. for Check = 1, #Players do
  1564. if Players[Check].ClassName == "Tool" and Players[Check]:FindFirstChild("Handle") ~= nil and Players[Check]:FindFirstChild("Active") ~= nil and Players[Check]:FindFirstChild("TargetPos") ~= nil and Players[Check]:FindFirstChild("Type") ~= nil and (Players[Check].Handle.Position - char.Torso.Position).Magnitude <= Distance then
  1565. local Ray = Ray.new(char.Torso.CFrame.p, (Players[Check].Handle.CFrame.p - char.Torso.CFrame.p).Unit * 100)
  1566. local Hit, Position = game.Workspace:FindPartOnRay(Ray, char)
  1567. if Hit ~= nil and Hit.Parent ~= nil and Hit.Parent == Players[Check] then
  1568. Distance = (Players[Check].Handle.Position - char.Torso.Position).Magnitude
  1569. Target = Players[Check]
  1570. end
  1571. end
  1572. end
  1573. if Target ~= nil and Target.ClassName == "Tool" then
  1574. if Distance <= 5 and HasTool == false then
  1575. Target.Parent = char
  1576. HasTool = true
  1577. else
  1578. Prep(Target.Handle.Position, Base)
  1579. end
  1580. else
  1581. for Check = 1, #Players do
  1582. if Players[Check].Name == "Crate" and Players[Check]:FindFirstChild("OpenCrate") ~= nil and Players[Check].OpenCrate.Value == false and (Players[Check].Position - char.Torso.Position).Magnitude <= Distance then
  1583. local Ray = Ray.new(char.Torso.CFrame.p, (Players[Check].CFrame.p - char.Torso.CFrame.p).Unit * 100)
  1584. local Hit, Position = game.Workspace:FindPartOnRay(Ray, char)
  1585. if Hit ~= nil and Hit == Players[Check] then
  1586. Target = Players[Check]
  1587. Distance = (Target.Position - char.Torso.Position).Magnitude
  1588. end
  1589. end
  1590. end
  1591. if Target ~= nil then
  1592. --char.Humanoid:MoveTo(Target.Position, Target)
  1593. if (Target.Position - char.Torso.Position).Magnitude <= 10 then
  1594. Target.OpenCrate.Value = true
  1595. end
  1596. else
  1597. local HasHat = false
  1598. local HatCheck = char:GetChildren()
  1599. for Check = 1, #HatCheck do
  1600. if ToolCheck[Check].ClassName == "Hat" then
  1601. HasHat = true
  1602. end
  1603. end
  1604. if HasHat == false then
  1605. Distance = 100
  1606. for Check = 1, #Players do
  1607. if Players[Check].ClassName == "Hat" and Players[Check]:FindFirstChild("Handle") ~= nil and (Players[Check].Handle.Position - char.Torso.Position).Magnitude <= Distance then
  1608. local Ray = Ray.new(char.Torso.CFrame.p, (Players[Check].Handle.CFrame.p - char.Torso.CFrame.p).Unit * 100)
  1609. local Hit, Position = game.Workspace:FindPartOnRay(Ray, char)
  1610. if Hit ~= nil and Hit.Parent ~= nil and Hit.Parent == Players[Check] then
  1611. Distance = (Players[Check].Handle.Position - char.Torso.Position).Magnitude
  1612. Target = Players[Check]
  1613. end
  1614. end
  1615. end
  1616. if Target ~= nil and Target.ClassName == "Hat" then
  1617. if Distance <= 5 and HasHat == false then
  1618. Target.Parent = char
  1619. HasHat = true
  1620. else
  1621. Prep(Target.Handle.Position, Base)
  1622. end
  1623. else
  1624. if char.Humanoid.PlatformStand == false and char.Humanoid.Sit == false then
  1625. if char.PathTo.Value ~= Vector3.new(0, 0, 0) then
  1626. GenerateMap(char.PathTo.Value)
  1627. char.PathTo.Value = Vector3.new(0, 0, 0)
  1628. elseif math.random(1, 10) == 1 and char.Wander.Value == true then
  1629. Prep(char.Torso.Position + Vector3.new(math.random(-100, 100), 0, math.random(-100, 100)), Base)
  1630. end
  1631. else
  1632. Jump()
  1633. end
  1634. end
  1635. end
  1636. end
  1637. end
  1638. else
  1639. if Target == nil then
  1640. local Distance = 80
  1641. local Players = Workspace:GetChildren()
  1642. for Check = 1, #Players do
  1643. if Players[Check]:FindFirstChild("Humanoid") ~= nil and Players[Check] ~= char and Players[Check]:FindFirstChild("IsLocalEnemy") == nil and Players[Check]:FindFirstChild("Leader") ~= nil and Players[Check].Humanoid.Health > 0 and Players[Check]:FindFirstChild("Torso") ~= nil and (Players[Check].Torso.Position - char.Torso.Position).Magnitude <= Distance then
  1644. local Ray = Ray.new(char.Torso.CFrame.p, (Players[Check].Torso.CFrame.p - char.Torso.CFrame.p).Unit * 100)
  1645. local Hit, Position = game.Workspace:FindPartOnRay(Ray, char)
  1646. if Hit ~= nil and Hit.Parent ~= nil and ((Hit.Parent:FindFirstChild("Humanoid") ~= nil and Hit.Parent == Players[Check]) or (Hit.Parent.Parent ~= nil and Hit.Parent.Parent:FindFirstChild("Humanoid") ~= nil and Hit.Parent.Parent == Players[Check])) then
  1647. Target = Players[Check].Torso
  1648. Distance = (Target.Position - char.Torso.Position).Magnitude
  1649. end
  1650. end
  1651. end
  1652. if Target ~= nil then
  1653. local Position = Target.Position + (char.Torso.Position - Target.Position).Unit * 10
  1654. Prep(Position, Base)
  1655. else
  1656. if char.Humanoid.PlatformStand == false and char.Humanoid.Sit == false then
  1657. if char.PathTo.Value ~= Vector3.new(0, 0, 0) then
  1658. GenerateMap(char.PathTo.Value)
  1659. char.PathTo.Value = Vector3.new(0, 0, 0)
  1660. elseif math.random(1, 10) == 1 and char.Wander.Value == true then
  1661. Prep(char.Torso.Position + Vector3.new(math.random(-100, 100), 0, math.random(-100, 100)), Base)
  1662. end
  1663. else
  1664. Jump()
  1665. end
  1666. end
  1667. else
  1668. if char.Humanoid.PlatformStand == false and char.Humanoid.Sit == false then
  1669. if char.PathTo.Value ~= Vector3.new(0, 0, 0) then
  1670. GenerateMap(char.PathTo.Value)
  1671. char.PathTo.Value = Vector3.new(0, 0, 0)
  1672. elseif math.random(1, 10) == 1 and char.Wander.Value == true then
  1673. Prep(char.Torso.Position + Vector3.new(math.random(-100, 100), 0, math.random(-100, 100)), Base)
  1674. end
  1675. else
  1676. Jump()
  1677. end
  1678. end
  1679. end
  1680. else
  1681. local Weapon = nil
  1682. local ToolCheck = char:GetChildren()
  1683. for Check = 1, #ToolCheck do
  1684. if ToolCheck[Check].ClassName == "Tool" then
  1685. Weapon = ToolCheck[Check]
  1686. end
  1687. end
  1688. if Weapon ~= nil and Weapon:FindFirstChild("Active") ~= nil and Weapon:FindFirstChild("TargetPos") ~= nil and Weapon:FindFirstChild("Type") ~= nil then
  1689. if Weapon.Type.Value == "Melee" then
  1690. Prep(Target.Position + Vector3.new(math.random(-3, 3), 0, math.random(-3, 3)), Target)
  1691. if (Target.Position - char.Torso.Position).Magnitude <= 10 then
  1692. Weapon.TargetPos.Value = Target.Position + Vector3.new(math.random(-2, 2), math.random(-2, 2), math.random(-2, 2))
  1693. Weapon.Active.Value = true
  1694. end
  1695. elseif Weapon.Type.Value == "Melee/Ranged" then
  1696. if Distance <= 10 then
  1697. Prep(Target.Position + Vector3.new(math.random(-3, 3), 0, math.random(-3, 3)), Target)
  1698. Weapon.TargetPos.Value = Target.Position + Vector3.new(math.random(-2, 2), math.random(-2, 2), math.random(-2, 2))
  1699. Weapon.Active.Value = true
  1700. else
  1701. Prep(Target.Position + (char.Torso.Position - Target.Position).Unit * 40, Base)
  1702. if (Target.Position - char.Torso.Position).Magnitude <= 50 then
  1703. Weapon.TargetPos.Value = Target.Position + Vector3.new(math.random(-2, 2), math.random(-2, 2), math.random(-2, 2))
  1704. Weapon.Active.Value = true
  1705. end
  1706. end
  1707. elseif Weapon.Type.Value == "Melee/RangedMed" then
  1708. if Distance <= 10 then
  1709. Prep(Target.Position + Vector3.new(math.random(-3, 3), 0, math.random(-3, 3)), Target)
  1710. Weapon.TargetPos.Value = Target.Position + Vector3.new(math.random(-2, 2), math.random(-2, 2), math.random(-2, 2))
  1711. Weapon.Active.Value = true
  1712. else
  1713. Prep(Target.Position + (char.Torso.Position - Target.Position).Unit * 30, Base)
  1714. if (Target.Position - char.Torso.Position).Magnitude <= 40 then
  1715. Weapon.TargetPos.Value = Target.Position + Vector3.new(math.random(-2, 2), math.random(-2, 2), math.random(-2, 2))
  1716. Weapon.Active.Value = true
  1717. end
  1718. end
  1719. elseif Weapon.Type.Value == "Melee/RangedClose" then
  1720. if Distance <= 10 then
  1721. Prep(Target.Position + Vector3.new(math.random(-3, 3), 0, math.random(-3, 3)), Target)
  1722. Weapon.TargetPos.Value = Target.Position + Vector3.new(math.random(-2, 2), math.random(-2, 2), math.random(-2, 2))
  1723. Weapon.Active.Value = true
  1724. else
  1725. Prep(Target.Position + (char.Torso.Position - Target.Position).Unit * 20, Base)
  1726. if (Target.Position - char.Torso.Position).Magnitude <= 30 then
  1727. Weapon.TargetPos.Value = Target.Position + Vector3.new(math.random(-2, 2), math.random(-2, 2), math.random(-2, 2))
  1728. Weapon.Active.Value = true
  1729. end
  1730. end
  1731. elseif Weapon.Type.Value == "Ranged" then
  1732. Prep(Target.Position + (char.Torso.Position - Target.Position).Unit * 80, Base)
  1733. Weapon.TargetPos.Value = Target.Position + Vector3.new(math.random(-2, 2), math.random(-2, 2), math.random(-2, 2))
  1734. wait()
  1735. Weapon.Active.Value = true
  1736. elseif Weapon.Type.Value == "RangedMed" then
  1737. Prep(Target.Position + (char.Torso.Position - Target.Position).Unit * 60, Base)
  1738. if Distance <= 70 then
  1739. Weapon.TargetPos.Value = Target.Position + Vector3.new(math.random(-2, 2), math.random(-2, 2), math.random(-2, 2))
  1740. wait()
  1741. Weapon.Active.Value = true
  1742. end
  1743. elseif Weapon.Type.Value == "RangedClose" then
  1744. Prep(Target.Position + (char.Torso.Position - Target.Position).Unit * 30, Base)
  1745. if Distance <= 40 then
  1746. Weapon.TargetPos.Value = Target.Position + Vector3.new(math.random(-2, 2), math.random(-2, 2), math.random(-2, 2))
  1747. wait()
  1748. Weapon.Active.Value = true
  1749. end
  1750. elseif Weapon.Type.Value == "RangedAngle" and Distance <= 100 then
  1751. local Position = Target.Position + (char.Torso.Position - Target.Position).Unit * (char.Torso.Position - Target.Position).Magnitude + Target.Velocity
  1752. --char.Humanoid:MoveTo(Position, Base)
  1753. Weapon.TargetPos.Value = Target.Position + Vector3.new(math.random(-2, 2), math.random(-2, 2), math.random(-2, 2))
  1754. wait()
  1755. Weapon.Active.Value = true
  1756. elseif Weapon.Type.Value == "RangedTactical" then
  1757. if Distance <= 30 then
  1758. local Position = Target.Position + (char.Torso.Position - Target.Position).Unit * 50
  1759. Prep(Position, Base)
  1760. elseif Distance >= 50 then
  1761. Prep(Target.Position, Target)
  1762. end
  1763. if Distance <= 50 and Distance >= 30 then
  1764. Prep(Target.Position + (char.Torso.Position - Target.Position).Unit * 40, Target.Parent.Torso)
  1765. end
  1766. if Distance <= 60 then
  1767. Weapon.TargetPos.Value = Target.Position + Vector3.new(math.random(-2, 2), math.random(-2, 2), math.random(-2, 2))
  1768. wait()
  1769. Weapon.Active.Value = true
  1770. end
  1771. elseif Weapon.Type.Value == "Shuriken" then
  1772. if Distance <= 15 then
  1773. local Position = Target.Position + (char.Torso.Position - Target.Position).Unit * 20
  1774. Prep(Position, Base)
  1775. elseif Distance >= 30 then
  1776. Prep(Target.Position, Target)
  1777. end
  1778. if Distance <= 30 and Distance >= 15 then
  1779. Prep(Target.Position + (char.Torso.Position - Target.Position).Unit * 20, Target.Parent.Torso)
  1780. end
  1781. if Distance <= 50 then
  1782. Weapon.TargetPos.Value = (Target.Position + Target.Velocity / 2) + Vector3.new(math.random(-2, 2), math.random(-2, 2) + ((Target.Position + Target.Velocity / 2) - char.Torso.Position).Magnitude / 8, math.random(-2, 2))
  1783. wait()
  1784. Weapon.Active.Value = true
  1785. end
  1786. elseif Weapon.Type.Value == "HealDrink" then
  1787. local Position = Target.Position + (char.Torso.Position - Target.Position).Unit * 120
  1788. Prep(Position, Base)
  1789. if char.Humanoid.Health < char.Humanoid.MaxHealth then
  1790. Weapon.Active.Value = true
  1791. end
  1792. elseif Weapon.Type.Value == "GrenadeDirect" then
  1793. if Distance >= 80 and Distance <= 100 then
  1794. Prep(Target.Position, Target)
  1795. wait(0.5)
  1796. Weapon.Active.Value = true
  1797. wait(0.5)
  1798. local Position = Target.Position + (char.Torso.Position - Target.Position).Unit * 100
  1799. Prep(Position, Base)
  1800. else
  1801. local Position = Target.Position + (char.Torso.Position - Target.Position).Unit * 100
  1802. Prep(Position, Base)
  1803. end
  1804. elseif Weapon.Type.Value == "Bomb" then
  1805. if Distance > 10 then
  1806. Prep(Target.Position, Target)
  1807. elseif Distance <= 10 then
  1808. Weapon.Active.Value = true
  1809. wait(2)
  1810. while Weapon ~= nil and Weapon:FindFirstChild("Handle") ~= nil and Weapon.Handle.Transparency == 1 do
  1811. Prep(Target.Position + (char.Torso.Position - Target.Position).Unit * 80, Base)
  1812. wait(0.5)
  1813. end
  1814. end
  1815. elseif Weapon.Type.Value == "Backstab" then
  1816. if Distance >= 10 then
  1817. if (char.Torso.Position - (Target.Position + Target.CFrame.lookVector * 50)).Magnitude <= 52 then
  1818. Prep(Target.Position, Target)
  1819. else
  1820. if (char.Torso.Position - (Target.Position - Target.CFrame.lookVector * 15)).Magnitude <= 5 then
  1821. Prep(Target.Position, Base)
  1822. local backstab_time = 20
  1823. while backstab_time > 1 and (char.Torso.Position - Target.Position).Magnitude >= 4 do
  1824. wait(0.1)
  1825. backstab_time = backstab_time - 1
  1826. end
  1827. if (char.Torso.Position - Target.Position).Magnitude < 4 then
  1828. Weapon.Active.Value = true
  1829. end
  1830. else
  1831. Prep(Target.Position - Target.CFrame.lookVector * 15, Base)
  1832. end
  1833. end
  1834. else
  1835. Prep(Target.Position + Vector3.new(math.random(-2, 2), 0, math.random(-2, 2)), Target)
  1836. if Distance <= 5 then
  1837. Weapon.Active.Value = true
  1838. end
  1839. end
  1840. elseif Weapon.Type.Value == "Crossbow" then
  1841. if Distance > 80 then
  1842. Prep(Target.Position, Target)
  1843. elseif Distance < 40 then
  1844. Prep(Target.Position + (char.Torso.Position - Target.Position).Unit * 100, Base)
  1845. elseif Distance <= 80 and Distance >= 40 then
  1846. Prep(Target.Position + (char.Torso.Position - Target.Position).Unit * ((char.Torso.Position - Target.Position).Magnitude - 5), Base)
  1847. wait(0.2)
  1848. Weapon.TargetPos.Value = Target.Position + Target.Velocity / 8 + Vector3.new(math.random(-2, 2), math.random(-2, 2), math.random(-2, 2))
  1849. Weapon.Active.Value = true
  1850. end
  1851. end
  1852. IsInCombat = true
  1853. elseif Distance <= 100 then
  1854. local Position = Target.Position + (char.Torso.Position - Target.Position).Unit * 120
  1855. Prep(Position, Base)
  1856. end
  1857. end
  1858. if IsInCombat == true then
  1859. wait(0.2)
  1860. else
  1861. wait(0.6)
  1862. end
  1863. end
  1864. local Weapon = nil
  1865. local ToolCheck = char:GetChildren()
  1866. for Check = 1, #ToolCheck do
  1867. if ToolCheck[Check].ClassName == "Tool" then
  1868. Weapon = ToolCheck[Check]
  1869. end
  1870. end
  1871. if Weapon ~= nil and char.DropWeapon.Value == true then
  1872. Weapon.Parent = Workspace
  1873. elseif Weapon ~= nil then
  1874. Weapon:Remove()
  1875. end
  1876. if char:FindFirstChild("IsAZombie") ~= nil then
  1877. char.Name = "New Zombie"
  1878. char.Humanoid.MaxHealth = char.Humanoid.MaxHealth + math.random(math.random(-50, -25), math.random(25, math.random(50, 100)))
  1879. wait()
  1880. char.Humanoid.Health = char.Humanoid.MaxHealth
  1881. char.Humanoid.WalkSpeed = char.Humanoid.WalkSpeed + math.random(math.random(-200, 0), math.random(100, math.random(200, 300))) / 100
  1882. ZStat = 2
  1883. ZStat2 = 1.57
  1884. Delay(1, function()
  1885. while char:FindFirstChild("Humanoid") ~= nil and char.Humanoid.Health > 0 do
  1886. char.Humanoid.MaxHealth = math.max(0, char.Humanoid.MaxHealth - 1)
  1887. char.Humanoid.Health = math.min(char.Humanoid.Health, char.Humanoid.MaxHealth)
  1888. wait(1)
  1889. end
  1890. end)
  1891. while char.Humanoid.Health > 0 and char:FindFirstChild("IsAZombie") ~= nil do
  1892. local Distance = 100
  1893. local Target = nil
  1894. local Players = Workspace:GetChildren()
  1895. for Check = 1, #Players do
  1896. if Players[Check]:FindFirstChild("Humanoid") ~= nil and Players[Check]:FindFirstChild("Torso") ~= nil and Players[Check]:FindFirstChild("IsAZombie") == nil and Players[Check].Humanoid.Health > 0 and (Players[Check].Torso.Position - char.Torso.Position).Magnitude <= 100 then
  1897. local ZRay = Ray.new(char.Torso.CFrame.p, (Players[Check].Torso.CFrame.p - char.Torso.CFrame.p).Unit * 100)
  1898. local ZHit, ZPos = Workspace:FindPartOnRay(ZRay, char)
  1899. if Players[Check]:FindFirstChild("ZFound") ~= nil or (ZHit ~= nil and ZHit.Parent ~= nil and ZHit.Parent.Parent ~= nil and (ZHit.Parent == Players[Check] or ZHit.Parent.Parent == Players[Check])) then
  1900. if ZHit ~= nil and ZHit.Parent ~= nil and ZHit.Parent.Parent ~= nil and (ZHit.Parent == Players[Check] or ZHit.Parent.Parent == Players[Check]) then
  1901. if Players[Check]:FindFirstChild("ZFound") ~= nil then
  1902. Players[Check].ZFound:Remove()
  1903. end
  1904. local ZTag = Instance.new("CFrameValue", Players[Check])
  1905. ZTag.Name = "ZFound"
  1906. game:GetService("Debris"):AddItem(ZTag, 5)
  1907. end
  1908. if (Players[Check].Torso.Position - char.Torso.Position).Magnitude <= Distance then
  1909. Target = Players[Check].Torso
  1910. Distance = (Target.Position - char.Torso.Position).Magnitude
  1911. end
  1912. end
  1913. end
  1914. end
  1915. if Target == nil then
  1916. if char.Humanoid.PlatformStand == false and char.Humanoid.Sit == false then
  1917. if math.random(1, 10) == 1 and char.Wander.Value == true then
  1918. Prep(char.Torso.Position + Vector3.new(math.random(-100, 100), 0, math.random(-100, 100)), Base)
  1919. end
  1920. else
  1921. Jump()
  1922. end
  1923. elseif char.Wander.Value == true then
  1924. --char.Humanoid:MoveTo(Target.Position + Vector3.new(math.random(-2, 2), 0, math.random(-2, 2)), Target)
  1925. end
  1926. wait(0.8)
  1927. end
  1928. end
  1929. end)
  1930. Delay(0, function() --Random Tool Usage Script
  1931. while true do
  1932. wait(math.random(40, 70 + math.random(30, 120)) / 10)
  1933. local Weapon = nil
  1934. local ToolCheck = char:GetChildren()
  1935. for Check = 1, #ToolCheck do
  1936. if ToolCheck[Check].ClassName == "Tool" then
  1937. Weapon = ToolCheck[Check]
  1938. end
  1939. end
  1940. if Weapon ~= nil and Weapon:FindFirstChild("Active") ~= nil and Weapon:FindFirstChild("TargetPos") ~= nil and Weapon:FindFirstChild("Type") ~= nil then
  1941. if Weapon.Type.Value == "HealDrink" then
  1942. Weapon.Active.Value = true
  1943. end
  1944. end
  1945. end
  1946. end)
  1947. Delay(1, function() --Player Customization Script
  1948. BColors = {3, 5, 12, 18, 108, 128, 138, 224, 224, 226, 226}
  1949. SColors = {145, 146, 147, 148, 149, 150, 168, 176, 178, 179, 200}
  1950. PColors = {190, 191, 193, 1024, 1025, 1026, 1027, 1028, 1029, 1030}
  1951. BColor = BrickColor.new(BColors[math.random(1, #BColors)])
  1952. SColor = BrickColor.new(SColors[math.random(1, #SColors)])
  1953. PColor = BrickColor.new(PColors[math.random(1, #PColors)])
  1954. if char.IsOnTeam.Value == true then
  1955. SColor = char.IsOnTeam.Team.Value
  1956. PColor = SColor
  1957. if char.IsOnTeam.ShowTag.Value == true then
  1958. char.Name = char.Name .." [" ..char.IsOnTeam.Team.Value.Name .."]"
  1959. end
  1960. end
  1961. char.Head.BrickColor = char["Body Colors"].HeadColor
  1962. char["Left Arm"].BrickColor = char["Body Colors"].LeftArmColor
  1963. char["Left Leg"].BrickColor = char["Body Colors"].LeftLegColor
  1964. char["Right Arm"].BrickColor = char["Body Colors"].RightArmColor
  1965. char["Right Leg"].BrickColor = char["Body Colors"].RightLegColor
  1966. char.Torso.BrickColor = char["Body Colors"].TorsoColor
  1967. if char["Force_Weapon"].Value ~= 0 then
  1968. local x = game:GetService("InsertService"):LoadAsset(char["Force_Weapon"].Value)
  1969. local c = x:GetChildren()
  1970. for i = 1, #c do
  1971. if c[i].ClassName == "Tool" and c[i]:FindFirstChild("AIProgram") ~= nil and c[i]:FindFirstChild("Active") ~= nil and c[i]:FindFirstChild("TargetPos") ~= nil and c[i]:FindFirstChild("Type") ~= nil and c[i]:FindFirstChild("Handle") ~= nil then
  1972. c[i].Parent = char
  1973. char.DropWeapon.Value = false
  1974. end
  1975. end
  1976. end
  1977. if char["Force_Hat"].Value ~= 0 then
  1978. local x = game:GetService("InsertService"):LoadAsset(char["Force_Hat"].Value)
  1979. local c = x:GetChildren()
  1980. for i = 1, #c do
  1981. if c[i].ClassName == "Hat" and c[i]:FindFirstChild("Handle") ~= nil then
  1982. c[i].Parent = char
  1983. end
  1984. end
  1985. end
  1986. if char["Force_Shirt"].Value ~= 0 then
  1987. local x = game:GetService("InsertService"):LoadAsset(char["Force_Shirt"].Value)
  1988. local c = x:GetChildren()
  1989. for i = 1, #c do
  1990. if c[i].ClassName == "Shirt" then
  1991. c[i].Parent = char
  1992. end
  1993. end
  1994. end
  1995. if char["Force_Pants"].Value ~= 0 then
  1996. local x = game:GetService("InsertService"):LoadAsset(char["Force_Pants"].Value)
  1997. local c = x:GetChildren()
  1998. for i = 1, #c do
  1999. if c[i].ClassName == "Pants" then
  2000. c[i].Parent = char
  2001. end
  2002. end
  2003. end
  2004. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement