Advertisement
Guest User

Ai

a guest
Aug 26th, 2018
2,366
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.  
  2. --Converted with ttyyuu12345's model to script plugin v4
  3. function sandbox(var,func)
  4. local env = getfenv(func)
  5. local newenv = setmetatable({},{
  6. __index = function(self,k)
  7. if k=="script" then
  8. return var
  9. else
  10. return env[k]
  11. end
  12. end,
  13. })
  14. setfenv(func,newenv)
  15. return func
  16. end
  17. cors = {}
  18. mas = Instance.new("Model",game:GetService("Lighting"))
  19. Model0 = Instance.new("Model")
  20. Part1 = Instance.new("Part")
  21. Script2 = Instance.new("Script")
  22. ScreenGui3 = Instance.new("ScreenGui")
  23. Frame4 = Instance.new("Frame")
  24. ImageLabel5 = Instance.new("ImageLabel")
  25. Script6 = Instance.new("Script")
  26. Script7 = Instance.new("Script")
  27. Script8 = Instance.new("Script")
  28. Sound9 = Instance.new("Sound")
  29. ImageLabel10 = Instance.new("ImageLabel")
  30. Script11 = Instance.new("Script")
  31. Script12 = Instance.new("Script")
  32. Sound13 = Instance.new("Sound")
  33. Part14 = Instance.new("Part")
  34. Motor6D15 = Instance.new("Motor6D")
  35. Motor6D16 = Instance.new("Motor6D")
  36. Motor6D17 = Instance.new("Motor6D")
  37. Motor6D18 = Instance.new("Motor6D")
  38. Motor6D19 = Instance.new("Motor6D")
  39. BodyForce20 = Instance.new("BodyForce")
  40. Part21 = Instance.new("Part")
  41. Part22 = Instance.new("Part")
  42. Part23 = Instance.new("Part")
  43. Part24 = Instance.new("Part")
  44. Part25 = Instance.new("Part")
  45. SpecialMesh26 = Instance.new("SpecialMesh")
  46. SpotLight27 = Instance.new("SpotLight")
  47. Humanoid28 = Instance.new("Humanoid")
  48. Backpack29 = Instance.new("Backpack")
  49. Script30 = Instance.new("Script")
  50. Script31 = Instance.new("Script")
  51. ObjectValue32 = Instance.new("ObjectValue")
  52. Script33 = Instance.new("Script")
  53. StringValue34 = Instance.new("StringValue")
  54. Animation35 = Instance.new("Animation")
  55. StringValue36 = Instance.new("StringValue")
  56. Animation37 = Instance.new("Animation")
  57. StringValue38 = Instance.new("StringValue")
  58. Animation39 = Instance.new("Animation")
  59. NumberValue40 = Instance.new("NumberValue")
  60. Animation41 = Instance.new("Animation")
  61. NumberValue42 = Instance.new("NumberValue")
  62. StringValue43 = Instance.new("StringValue")
  63. Animation44 = Instance.new("Animation")
  64. StringValue45 = Instance.new("StringValue")
  65. Animation46 = Instance.new("Animation")
  66. StringValue47 = Instance.new("StringValue")
  67. Animation48 = Instance.new("Animation")
  68. StringValue49 = Instance.new("StringValue")
  69. Animation50 = Instance.new("Animation")
  70. StringValue51 = Instance.new("StringValue")
  71. Animation52 = Instance.new("Animation")
  72. Script53 = Instance.new("Script")
  73. Script54 = Instance.new("Script")
  74. Script55 = Instance.new("Script")
  75. Script56 = Instance.new("Script")
  76. Part57 = Instance.new("Part")
  77. Motor6D58 = Instance.new("Motor6D")
  78. SpecialMesh59 = Instance.new("SpecialMesh")
  79. Part60 = Instance.new("Part")
  80. BillboardGui61 = Instance.new("BillboardGui")
  81. ImageLabel62 = Instance.new("ImageLabel")
  82. Script63 = Instance.new("Script")
  83. Part64 = Instance.new("Part")
  84. Part65 = Instance.new("Part")
  85. Part66 = Instance.new("Part")
  86. BillboardGui67 = Instance.new("BillboardGui")
  87. ImageLabel68 = Instance.new("ImageLabel")
  88. Script69 = Instance.new("Script")
  89. Camera70 = Instance.new("Camera")
  90. Model0.Name = "Ignited Bonnie"
  91. Model0.Parent = mas
  92. Part1.Name = "Jumpscare Box"
  93. Part1.Parent = Model0
  94. Part1.CFrame = CFrame.new(-18.7641983, 3.59502602, 236.232513, 4.49431016e-21, -6.79974523e-22, -1, 4.72251821e-22, 1, -6.79974523e-22, 1, -4.72251821e-22, 4.49431016e-21)
  95. Part1.Orientation = Vector3.new(0, -90, 0)
  96. Part1.Position = Vector3.new(-18.7641983, 3.59502602, 236.232513)
  97. Part1.Rotation = Vector3.new(0, -90, 0)
  98. Part1.Color = Color3.new(0.152941, 0.27451, 0.176471)
  99. Part1.Transparency = 1
  100. Part1.Size = Vector3.new(3.43617249, 7.18966675, 3.5197773)
  101. Part1.BottomSurface = Enum.SurfaceType.Smooth
  102. Part1.BrickColor = BrickColor.new("Earth green")
  103. Part1.CanCollide = false
  104. Part1.Material = Enum.Material.WoodPlanks
  105. Part1.TopSurface = Enum.SurfaceType.Smooth
  106. Part1.brickColor = BrickColor.new("Earth green")
  107. Part1.FormFactor = Enum.FormFactor.Symmetric
  108. Part1.formFactor = Enum.FormFactor.Symmetric
  109. Script2.Name = "S2"
  110. Script2.Parent = Part1
  111. table.insert(cors,sandbox(Script2,function()
  112.  
  113. Popup = script.Parent.Popup
  114. Ready = true
  115. function onTouch(hit)
  116. local h = hit.Parent:FindFirstChild("Humanoid")
  117. if h ~= nil and Ready == true then
  118. Ready = false
  119. local plyr = game.Players:FindFirstChild(h.Parent.Name)
  120. wait()
  121. local c = Popup:clone()
  122. c.Parent = plyr.PlayerGui
  123. c.BackGround.Image.StuffScript.Disabled=false
  124. h.Health=0
  125. wait(1)
  126. wait(.1)
  127.  
  128. c:remove()
  129. wait(1)
  130. Ready = true
  131. end
  132. end
  133.  
  134. script.Parent.Touched:connect(onTouch)
  135.  
  136. end))
  137. ScreenGui3.Name = "Popup"
  138. ScreenGui3.Parent = Part1
  139. Frame4.Name = "BackGround"
  140. Frame4.Parent = ScreenGui3
  141. Frame4.Position = UDim2.new(0, 0, -0.100000001, 0)
  142. Frame4.Size = UDim2.new(1.10000002, 0, 1.20000005, 0)
  143. Frame4.BackgroundColor = BrickColor.new("Black metallic")
  144. Frame4.BackgroundColor3 = Color3.new(0.109804, 0.109804, 0.109804)
  145. Frame4.BackgroundTransparency = 1
  146. ImageLabel5.Name = "Image"
  147. ImageLabel5.Parent = Frame4
  148. ImageLabel5.Position = UDim2.new(-0.200000003, -66, -0.100000001, -9)
  149. ImageLabel5.Rotation = 4.6521444320679
  150. ImageLabel5.Size = UDim2.new(1.29999995, 0, 1.29999995, 0)
  151. ImageLabel5.BackgroundColor = BrickColor.new("Really black")
  152. ImageLabel5.BackgroundColor3 = Color3.new(0, 0, 0)
  153. ImageLabel5.BackgroundTransparency = 1
  154. ImageLabel5.Image = "rbxassetid://940919723"
  155. Script6.Parent = ImageLabel5
  156. table.insert(cors,sandbox(Script6,function()
  157. while wait() do
  158. script.Parent.Rotation = math.sin(tick() * 50) * 10
  159. end
  160. end))
  161. Script7.Name = "IntroGUI Script [READ]"
  162. Script7.Parent = ImageLabel5
  163. table.insert(cors,sandbox(Script7,function()
  164.  
  165. while true do
  166. script.Parent.Position = script.Parent.Position + UDim2.new(0, math.random(-100, 100), 0, math.random(-100, 100))
  167. wait(0.02)
  168. script.Parent.Position = UDim2.new(-0.2, 0,-0.1, 0)
  169. wait(0.02)
  170. end
  171.  
  172. end))
  173. Script8.Name = "StuffScript"
  174. Script8.Parent = ImageLabel5
  175. table.insert(cors,sandbox(Script8,function()
  176. script.Sound:play()
  177. de = 0
  178. repeat wait() de = de + 1 script.Parent.Parent.Size = script.Parent.Parent.Size + UDim2.new(0, 60, 0, 40)
  179. script.Parent.Parent.Position = script.Parent.Parent.Position + UDim2.new(0, -30, 0, -20) until de == 40
  180.  
  181.  
  182. script.Parent.Parent.Static.Visible=true
  183. script.Parent.Parent.Scream2:play()
  184. wait(.1)
  185. script.Sound:stop()
  186. wait(.1)
  187. script.Parent:remove()
  188. end))
  189. Script8.Disabled = true
  190. Sound9.Parent = Script8
  191. Sound9.EmitterSize = 0
  192. Sound9.MinDistance = 0
  193. Sound9.Pitch = 1.5
  194. Sound9.PlaybackSpeed = 1.5
  195. Sound9.SoundId = "rbxassetid://752370783"
  196. Sound9.Volume = 1
  197. ImageLabel10.Name = "Static"
  198. ImageLabel10.Parent = Frame4
  199. ImageLabel10.Position = UDim2.new(-0.200000003, -56, -0.100000001, 65)
  200. ImageLabel10.Rotation = 4.6577825546265
  201. ImageLabel10.Visible = false
  202. ImageLabel10.Size = UDim2.new(1, 0, 1, 0)
  203. ImageLabel10.BackgroundColor = BrickColor.new("Dark grey metallic")
  204. ImageLabel10.BackgroundColor3 = Color3.new(0.356863, 0.356863, 0.364706)
  205. ImageLabel10.BorderSizePixel = 0
  206. ImageLabel10.ZIndex = 10
  207. ImageLabel10.Image = "rbxassetid://125514848"
  208. ImageLabel10.ImageColor3 = Color3.new(0, 0, 0)
  209. Script11.Name = "IntroGUI Script [READ]"
  210. Script11.Parent = ImageLabel10
  211. table.insert(cors,sandbox(Script11,function()
  212.  
  213. while true do
  214. script.Parent.Position = script.Parent.Position + UDim2.new(0, math.random(-100, 100), 0, math.random(-100, 100))
  215. wait(0.05)
  216. script.Parent.Position = UDim2.new(-0.2, 0,-0.1, 0)
  217. wait(0.05)
  218. end
  219.  
  220. end))
  221. Script12.Parent = ImageLabel10
  222. table.insert(cors,sandbox(Script12,function()
  223. while wait() do
  224. script.Parent.Rotation = math.sin(tick() * 0) * 10
  225. end
  226. end))
  227. Sound13.Name = "Scream2"
  228. Sound13.Parent = Frame4
  229. Sound13.Looped = true
  230. Sound13.EmitterSize = 0
  231. Sound13.MinDistance = 0
  232. Sound13.Volume = 1
  233. Part14.Name = "Torso"
  234. Part14.Parent = Model0
  235. Part14.CFrame = CFrame.new(-18.7492905, 3.00002193, 236.262543, 4.49431016e-21, -6.79974523e-22, -1, 4.72251821e-22, 1, -6.79974523e-22, 1, -4.72251821e-22, 4.49431016e-21)
  236. Part14.Orientation = Vector3.new(0, -90, 0)
  237. Part14.Position = Vector3.new(-18.7492905, 3.00002193, 236.262543)
  238. Part14.Rotation = Vector3.new(0, -90, 0)
  239. Part14.Color = Color3.new(0.152941, 0.27451, 0.176471)
  240. Part14.Transparency = 1
  241. Part14.Size = Vector3.new(2, 2, 1)
  242. Part14.BottomSurface = Enum.SurfaceType.Smooth
  243. Part14.BrickColor = BrickColor.new("Earth green")
  244. Part14.Material = Enum.Material.WoodPlanks
  245. Part14.TopSurface = Enum.SurfaceType.Smooth
  246. Part14.brickColor = BrickColor.new("Earth green")
  247. Part14.FormFactor = Enum.FormFactor.Symmetric
  248. Part14.formFactor = Enum.FormFactor.Symmetric
  249. Motor6D15.Name = "Left Hip"
  250. Motor6D15.Parent = Part14
  251. Motor6D15.MaxVelocity = 0.10000000149012
  252. Motor6D15.C0 = CFrame.new(-1, -1, 0, -4.37113883e-08, 0, -1, 0, 0.99999994, 0, 1, 0, -4.37113883e-08)
  253. Motor6D15.C1 = CFrame.new(-0.5, 1, 0, -4.37113883e-08, 0, -1, 0, 0.99999994, 0, 1, 0, -4.37113883e-08)
  254. Motor6D15.Part0 = Part14
  255. Motor6D15.Part1 = Part21
  256. Motor6D15.part1 = Part21
  257. Motor6D16.Name = "Right Hip"
  258. Motor6D16.Parent = Part14
  259. Motor6D16.MaxVelocity = 0.10000000149012
  260. Motor6D16.C0 = CFrame.new(1, -1, 0, -4.37113883e-08, 0, 1, -0, 0.99999994, 0, -1, 0, -4.37113883e-08)
  261. Motor6D16.C1 = CFrame.new(0.5, 1, 0, -4.37113883e-08, 0, 1, 0, 0.99999994, 0, -1, 0, -4.37113883e-08)
  262. Motor6D16.Part0 = Part14
  263. Motor6D16.Part1 = Part22
  264. Motor6D16.part1 = Part22
  265. Motor6D17.Name = "Left Shoulder"
  266. Motor6D17.Parent = Part14
  267. Motor6D17.MaxVelocity = 0.10000000149012
  268. Motor6D17.C0 = CFrame.new(-1, 0.5, 0, -4.37113883e-08, 0, -1, 0, 0.99999994, 0, 1, 0, -4.37113883e-08)
  269. Motor6D17.C1 = CFrame.new(0.5, 0.5, 0, -4.37113883e-08, 0, -1, 0, 0.99999994, 0, 1, 0, -4.37113883e-08)
  270. Motor6D17.Part0 = Part14
  271. Motor6D17.Part1 = Part23
  272. Motor6D17.part1 = Part23
  273. Motor6D18.Name = "Right Shoulder"
  274. Motor6D18.Parent = Part14
  275. Motor6D18.MaxVelocity = 0.10000000149012
  276. Motor6D18.C0 = CFrame.new(1, 0.5, 0, -4.37113883e-08, 0, 1, -0, 0.99999994, 0, -1, 0, -4.37113883e-08)
  277. Motor6D18.C1 = CFrame.new(-0.5, 0.5, 0, -4.37113883e-08, 0, 1, 0, 0.99999994, 0, -1, 0, -4.37113883e-08)
  278. Motor6D18.Part0 = Part14
  279. Motor6D18.Part1 = Part24
  280. Motor6D18.part1 = Part24
  281. Motor6D19.Name = "Neck"
  282. Motor6D19.Parent = Part14
  283. Motor6D19.MaxVelocity = 0.10000000149012
  284. Motor6D19.C0 = CFrame.new(0, 1, 0, -1, 0, 0, 0, 0, 1, 0, 1, -0)
  285. Motor6D19.C1 = CFrame.new(0, -0.5, 0, -1, 0, 0, 0, 0, 1, 0, 1, -0)
  286. Motor6D19.Part0 = Part14
  287. Motor6D19.Part1 = Part25
  288. Motor6D19.part1 = Part25
  289. BodyForce20.Name = "RepulsionForce"
  290. BodyForce20.Parent = Part14
  291. BodyForce20.Force = Vector3.new(0, 0, 0)
  292. BodyForce20.force = Vector3.new(0, 0, 0)
  293. Part21.Name = "Left Leg"
  294. Part21.Parent = Model0
  295. Part21.CFrame = CFrame.new(-18.7492905, 1.00002205, 235.762543, 4.49431016e-21, -6.79974422e-22, -1, 4.72251821e-22, 0.999999881, -6.79974523e-22, 1, -4.7225177e-22, 4.49431016e-21)
  296. Part21.Orientation = Vector3.new(0, -90, 0)
  297. Part21.Position = Vector3.new(-18.7492905, 1.00002205, 235.762543)
  298. Part21.Rotation = Vector3.new(0, -90, 0)
  299. Part21.Color = Color3.new(0.152941, 0.27451, 0.176471)
  300. Part21.Transparency = 1
  301. Part21.Size = Vector3.new(1, 2, 1)
  302. Part21.BottomSurface = Enum.SurfaceType.Smooth
  303. Part21.BrickColor = BrickColor.new("Earth green")
  304. Part21.CanCollide = false
  305. Part21.Material = Enum.Material.WoodPlanks
  306. Part21.TopSurface = Enum.SurfaceType.Smooth
  307. Part21.brickColor = BrickColor.new("Earth green")
  308. Part21.FormFactor = Enum.FormFactor.Symmetric
  309. Part21.formFactor = Enum.FormFactor.Symmetric
  310. Part22.Name = "Right Leg"
  311. Part22.Parent = Model0
  312. Part22.CFrame = CFrame.new(-18.7492905, 1.00002205, 236.762543, 4.49431016e-21, -6.79974422e-22, -1, 4.72251821e-22, 0.999999881, -6.79974523e-22, 1, -4.7225177e-22, 4.49431016e-21)
  313. Part22.Orientation = Vector3.new(0, -90, 0)
  314. Part22.Position = Vector3.new(-18.7492905, 1.00002205, 236.762543)
  315. Part22.Rotation = Vector3.new(0, -90, 0)
  316. Part22.Color = Color3.new(0.152941, 0.27451, 0.176471)
  317. Part22.Transparency = 1
  318. Part22.Size = Vector3.new(1, 2, 1)
  319. Part22.BottomSurface = Enum.SurfaceType.Smooth
  320. Part22.BrickColor = BrickColor.new("Earth green")
  321. Part22.CanCollide = false
  322. Part22.Material = Enum.Material.WoodPlanks
  323. Part22.TopSurface = Enum.SurfaceType.Smooth
  324. Part22.brickColor = BrickColor.new("Earth green")
  325. Part22.FormFactor = Enum.FormFactor.Symmetric
  326. Part22.formFactor = Enum.FormFactor.Symmetric
  327. Part23.Name = "Left Arm"
  328. Part23.Parent = Model0
  329. Part23.CFrame = CFrame.new(-18.7492905, 3.00002193, 234.762543, 4.49431016e-21, -6.79974422e-22, -1, 4.72251821e-22, 0.999999881, -6.79974523e-22, 1, -4.7225177e-22, 4.49431016e-21)
  330. Part23.Orientation = Vector3.new(0, -90, 0)
  331. Part23.Position = Vector3.new(-18.7492905, 3.00002193, 234.762543)
  332. Part23.Rotation = Vector3.new(0, -90, 0)
  333. Part23.Color = Color3.new(0.152941, 0.27451, 0.176471)
  334. Part23.Transparency = 1
  335. Part23.Size = Vector3.new(1, 2, 1)
  336. Part23.BottomSurface = Enum.SurfaceType.Smooth
  337. Part23.BrickColor = BrickColor.new("Earth green")
  338. Part23.CanCollide = false
  339. Part23.Material = Enum.Material.WoodPlanks
  340. Part23.TopSurface = Enum.SurfaceType.Smooth
  341. Part23.brickColor = BrickColor.new("Earth green")
  342. Part23.FormFactor = Enum.FormFactor.Symmetric
  343. Part23.formFactor = Enum.FormFactor.Symmetric
  344. Part24.Name = "Right Arm"
  345. Part24.Parent = Model0
  346. Part24.CFrame = CFrame.new(-18.7492905, 3.00002193, 237.762543, 4.49431016e-21, -6.79974422e-22, -1, 4.72251821e-22, 0.999999881, -6.79974523e-22, 1, -4.7225177e-22, 4.49431016e-21)
  347. Part24.Orientation = Vector3.new(0, -90, 0)
  348. Part24.Position = Vector3.new(-18.7492905, 3.00002193, 237.762543)
  349. Part24.Rotation = Vector3.new(0, -90, 0)
  350. Part24.Color = Color3.new(0.152941, 0.27451, 0.176471)
  351. Part24.Transparency = 1
  352. Part24.Size = Vector3.new(1, 2, 1)
  353. Part24.BottomSurface = Enum.SurfaceType.Smooth
  354. Part24.BrickColor = BrickColor.new("Earth green")
  355. Part24.CanCollide = false
  356. Part24.Material = Enum.Material.WoodPlanks
  357. Part24.TopSurface = Enum.SurfaceType.Smooth
  358. Part24.brickColor = BrickColor.new("Earth green")
  359. Part24.FormFactor = Enum.FormFactor.Symmetric
  360. Part24.formFactor = Enum.FormFactor.Symmetric
  361. Part25.Name = "Head"
  362. Part25.Parent = Model0
  363. Part25.CFrame = CFrame.new(-18.7492905, 4.50002193, 236.262543, 4.49431016e-21, -6.79974523e-22, -1, 4.72251821e-22, 1, -6.79974523e-22, 1, -4.72251821e-22, 4.49431016e-21)
  364. Part25.Orientation = Vector3.new(0, -90, 0)
  365. Part25.Position = Vector3.new(-18.7492905, 4.50002193, 236.262543)
  366. Part25.Rotation = Vector3.new(0, -90, 0)
  367. Part25.Color = Color3.new(0.227451, 0.490196, 0.0823529)
  368. Part25.Transparency = 1
  369. Part25.Size = Vector3.new(2, 1, 1)
  370. Part25.BottomSurface = Enum.SurfaceType.Smooth
  371. Part25.BrickColor = BrickColor.new("Camo")
  372. Part25.Material = Enum.Material.WoodPlanks
  373. Part25.TopSurface = Enum.SurfaceType.Smooth
  374. Part25.brickColor = BrickColor.new("Camo")
  375. Part25.FormFactor = Enum.FormFactor.Symmetric
  376. Part25.formFactor = Enum.FormFactor.Symmetric
  377. SpecialMesh26.Parent = Part25
  378. SpecialMesh26.Scale = Vector3.new(1.25, 1.25, 1.25)
  379. SpotLight27.Parent = Part25
  380. SpotLight27.Color = Color3.new(1, 0, 0)
  381. SpotLight27.Range = 30
  382. SpotLight27.Brightness = inf
  383. Humanoid28.Parent = Model0
  384. Humanoid28.Health = inf
  385. Humanoid28.JumpPower = 20
  386. Humanoid28.LeftLeg = Part21
  387. Humanoid28.MaxHealth = inf
  388. Humanoid28.RightLeg = Part22
  389. Humanoid28.Torso = Part57
  390. Humanoid28.WalkSpeed = 30
  391. Humanoid28.maxHealth = inf
  392. Backpack29.Name = "AI"
  393. Backpack29.Parent = Model0
  394. Script30.Name = "Pathfinding"
  395. Script30.Parent = Backpack29
  396. table.insert(cors,sandbox(Script30,function()
  397. debugMode = false
  398. targetNPCs = false
  399.  
  400. --
  401.  
  402. h = script.Parent.Parent:WaitForChild("Humanoid")
  403. pathService = game:GetService("PathfindingService")
  404. targetV = script.Parent:WaitForChild("Target")
  405.  
  406. function closestTargetAndPath()
  407. local humanoids = {}
  408. if targetNPCs then
  409. local function recurse(o)
  410. for _,obj in pairs(o:GetChildren()) do
  411. if obj:IsA("Model") then
  412. if obj:findFirstChild("Humanoid") and obj:findFirstChild("Torso") and obj.Humanoid ~= h and obj.Humanoid.Health > 0 and not obj:findFirstChild("ForceField") then
  413. table.insert(humanoids,obj.Humanoid)
  414. end
  415. end
  416. recurse(obj)
  417. end
  418. end
  419. recurse(workspace)
  420. else
  421. for _,v in pairs(game.Players:GetPlayers()) do
  422. if v.Character and v.Character:findFirstChild("HumanoidRootPart") and v.Character:findFirstChild("Humanoid") and v.Character.Humanoid.Health > 0 and not v:findFirstChild("ForceField") then
  423. table.insert(humanoids,v.Character.Humanoid)
  424. end
  425. end
  426. end
  427. local closest,path,dist
  428. for _,humanoid in pairs(humanoids) do
  429. local myPath = pathService:ComputeRawPathAsync(h.Torso.Position,humanoid.Torso.Position,500)
  430. if myPath.Status ~= Enum.PathStatus.FailFinishNotEmpty then
  431. -- Now that we have a successful path, we need to figure out how far we need to actually travel to reach this point.
  432. local myDist = 0
  433. local previous = h.Torso.Position
  434. for _,point in pairs(myPath:GetPointCoordinates()) do
  435. myDist = myDist + (point-previous).magnitude
  436. previous = point
  437. end
  438. if not dist or myDist < dist then -- if true, this is the closest path so far.
  439. closest = humanoid
  440. path = myPath
  441. dist = myDist
  442. end
  443. end
  444. end
  445. return closest,path
  446. end
  447.  
  448. function goToPos(loc)
  449. h:MoveTo(loc)
  450. local distance = (loc-h.Torso.Position).magnitude
  451. local start = tick()
  452. while distance > 4 do
  453. if tick()-start > distance/h.WalkSpeed then -- Something may have gone wrong. Just break.
  454. break
  455. end
  456. distance = (loc-h.Torso.Position).magnitude
  457. wait()
  458. end
  459. end
  460.  
  461. while wait() do
  462. local target,path = closestTargetAndPath()
  463. local didBreak = false
  464. local targetStart
  465. if target and h.Torso then
  466. targetV.Value = target
  467. targetStart = target.Torso.Position
  468. roaming = false
  469. local previous = h.Torso.Position
  470. local points = path:GetPointCoordinates()
  471. local s = #points > 1 and 2 or 1
  472. for i = s,#points do
  473. local point = points[i]
  474. if didBreak then
  475. break
  476. end
  477. if target and target.Torso and target.Health > 0 then
  478. if (target.Torso.Position-targetStart).magnitude < 1.5 then
  479. local pos = previous:lerp(point,.5)
  480. local moveDir = ((pos - h.Torso.Position).unit * 2)
  481. goToPos(previous:lerp(point,.5))
  482. previous = point
  483. end
  484. else
  485. didBreak = true
  486. break
  487. end
  488. end
  489. else
  490. targetV.Value = nil
  491. end
  492. if not didBreak and targetStart then
  493. goToPos(targetStart)
  494. end
  495. end
  496. end))
  497. Script31.Name = "AutoJump"
  498. Script31.Parent = Backpack29
  499. table.insert(cors,sandbox(Script31,function()
  500. local h = script.Parent.Parent:WaitForChild("Humanoid")
  501.  
  502. while wait(math.random()/4) do
  503. local check1 = game.Workspace:FindPartOnRay(Ray.new(h.Torso.Position-Vector3.new(0,1.5,0), h.Torso.CFrame.lookVector*3), h.Parent)
  504. local check2 = game.Workspace:FindPartOnRay(Ray.new(h.Torso.Position+Vector3.new(0,1.5,0), h.Torso.CFrame.lookVector*3), h.Parent)
  505. if check1 or check2 then
  506. h.Jump = true
  507. end
  508. end
  509. end))
  510. ObjectValue32.Name = "Target"
  511. ObjectValue32.Parent = Backpack29
  512. Script33.Name = "Animate"
  513. Script33.Parent = Model0
  514. table.insert(cors,sandbox(Script33,function()
  515. -- This is in charge of the animations for the character. Pretty much stole it from the default character. Removed emote stuff.
  516. function waitForChild(parent, childName)
  517. local child = parent:findFirstChild(childName)
  518. if child then return child end
  519. while true do
  520. child = parent.ChildAdded:wait()
  521. if child.Name==childName then return child end
  522. end
  523. end
  524.  
  525. local Figure = script.Parent
  526. local Torso = waitForChild(Figure, "Torso")
  527. local RightShoulder = waitForChild(Torso, "Right Shoulder")
  528. local LeftShoulder = waitForChild(Torso, "Left Shoulder")
  529. local RightHip = waitForChild(Torso, "Right Hip")
  530. local LeftHip = waitForChild(Torso, "Left Hip")
  531. local Neck = waitForChild(Torso, "Neck")
  532. local Humanoid = waitForChild(Figure, "Humanoid")
  533. local pose = "Standing"
  534.  
  535. local currentAnim = ""
  536. local currentAnimInstance = nil
  537. local currentAnimTrack = nil
  538. local currentAnimKeyframeHandler = nil
  539. local currentAnimSpeed = 1.0
  540. local animTable = {}
  541. local animNames = {
  542. idle = {
  543. { id = "http://www.roblox.com/asset/?id=180435571", weight = 9 },
  544. { id = "http://www.roblox.com/asset/?id=180435792", weight = 1 }
  545. },
  546. walk = {
  547. { id = "http://www.roblox.com/asset/?id=180426354", weight = 10 }
  548. },
  549. run = {
  550. { id = "run.xml", weight = 10 }
  551. },
  552. jump = {
  553. { id = "http://www.roblox.com/asset/?id=125750702", weight = 10 }
  554. },
  555. fall = {
  556. { id = "http://www.roblox.com/asset/?id=180436148", weight = 10 }
  557. },
  558. climb = {
  559. { id = "http://www.roblox.com/asset/?id=180436334", weight = 10 }
  560. },
  561. sit = {
  562. { id = "http://www.roblox.com/asset/?id=178130996", weight = 10 }
  563. },
  564. toolnone = {
  565. { id = "http://www.roblox.com/asset/?id=182393478", weight = 10 }
  566. },
  567. toolslash = {
  568. { id = "http://www.roblox.com/asset/?id=129967390", weight = 10 }
  569. -- { id = "slash.xml", weight = 10 }
  570. },
  571. toollunge = {
  572. { id = "http://www.roblox.com/asset/?id=129967478", weight = 10 }
  573. },
  574. wave = {
  575. { id = "http://www.roblox.com/asset/?id=128777973", weight = 10 }
  576. },
  577. point = {
  578. { id = "http://www.roblox.com/asset/?id=128853357", weight = 10 }
  579. },
  580. dance = {
  581. { id = "http://www.roblox.com/asset/?id=182435998", weight = 10 },
  582. { id = "http://www.roblox.com/asset/?id=182491037", weight = 10 },
  583. { id = "http://www.roblox.com/asset/?id=182491065", weight = 10 }
  584. },
  585. dance2 = {
  586. { id = "http://www.roblox.com/asset/?id=182436842", weight = 10 },
  587. { id = "http://www.roblox.com/asset/?id=182491248", weight = 10 },
  588. { id = "http://www.roblox.com/asset/?id=182491277", weight = 10 }
  589. },
  590. dance3 = {
  591. { id = "http://www.roblox.com/asset/?id=182436935", weight = 10 },
  592. { id = "http://www.roblox.com/asset/?id=182491368", weight = 10 },
  593. { id = "http://www.roblox.com/asset/?id=182491423", weight = 10 }
  594. },
  595. laugh = {
  596. { id = "http://www.roblox.com/asset/?id=129423131", weight = 10 }
  597. },
  598. cheer = {
  599. { id = "http://www.roblox.com/asset/?id=129423030", weight = 10 }
  600. },
  601. }
  602.  
  603. math.randomseed(tick())
  604.  
  605. function configureAnimationSet(name, fileList)
  606. if (animTable[name] ~= nil) then
  607. for _, connection in pairs(animTable[name].connections) do
  608. connection:disconnect()
  609. end
  610. end
  611. animTable[name] = {}
  612. animTable[name].count = 0
  613. animTable[name].totalWeight = 0
  614. animTable[name].connections = {}
  615.  
  616. -- check for config values
  617. local config = script:FindFirstChild(name)
  618. if (config ~= nil) then
  619. -- print("Loading anims " .. name)
  620. table.insert(animTable[name].connections, config.ChildAdded:connect(function(child) configureAnimationSet(name, fileList) end))
  621. table.insert(animTable[name].connections, config.ChildRemoved:connect(function(child) configureAnimationSet(name, fileList) end))
  622. local idx = 1
  623. for _, childPart in pairs(config:GetChildren()) do
  624. if (childPart:IsA("Animation")) then
  625. table.insert(animTable[name].connections, childPart.Changed:connect(function(property) configureAnimationSet(name, fileList) end))
  626. animTable[name][idx] = {}
  627. animTable[name][idx].anim = childPart
  628. local weightObject = childPart:FindFirstChild("Weight")
  629. if (weightObject == nil) then
  630. animTable[name][idx].weight = 1
  631. else
  632. animTable[name][idx].weight = weightObject.Value
  633. end
  634. animTable[name].count = animTable[name].count + 1
  635. animTable[name].totalWeight = animTable[name].totalWeight + animTable[name][idx].weight
  636. -- print(name .. " [" .. idx .. "] " .. animTable[name][idx].anim.AnimationId .. " (" .. animTable[name][idx].weight .. ")")
  637. idx = idx + 1
  638. end
  639. end
  640. end
  641.  
  642. -- fallback to defaults
  643. if (animTable[name].count <= 0) then
  644. for idx, anim in pairs(fileList) do
  645. animTable[name][idx] = {}
  646. animTable[name][idx].anim = Instance.new("Animation")
  647. animTable[name][idx].anim.Name = name
  648. animTable[name][idx].anim.AnimationId = anim.id
  649. animTable[name][idx].weight = anim.weight
  650. animTable[name].count = animTable[name].count + 1
  651. animTable[name].totalWeight = animTable[name].totalWeight + anim.weight
  652. -- print(name .. " [" .. idx .. "] " .. anim.id .. " (" .. anim.weight .. ")")
  653. end
  654. end
  655. end
  656.  
  657. -- Setup animation objects
  658. function scriptChildModified(child)
  659. local fileList = animNames[child.Name]
  660. if (fileList ~= nil) then
  661. configureAnimationSet(child.Name, fileList)
  662. end
  663. end
  664.  
  665. script.ChildAdded:connect(scriptChildModified)
  666. script.ChildRemoved:connect(scriptChildModified)
  667.  
  668.  
  669. for name, fileList in pairs(animNames) do
  670. configureAnimationSet(name, fileList)
  671. end
  672.  
  673. -- ANIMATION
  674.  
  675. -- declarations
  676. local toolAnim = "None"
  677. local toolAnimTime = 0
  678.  
  679. local jumpAnimTime = 0
  680. local jumpAnimDuration = 0.3
  681.  
  682. local toolTransitionTime = 0.1
  683. local fallTransitionTime = 0.3
  684. local jumpMaxLimbVelocity = 0.75
  685.  
  686. -- functions
  687.  
  688. function stopAllAnimations()
  689. local oldAnim = currentAnim
  690.  
  691. currentAnim = ""
  692. currentAnimInstance = nil
  693. if (currentAnimKeyframeHandler ~= nil) then
  694. currentAnimKeyframeHandler:disconnect()
  695. end
  696.  
  697. if (currentAnimTrack ~= nil) then
  698. currentAnimTrack:Stop()
  699. currentAnimTrack:Destroy()
  700. currentAnimTrack = nil
  701. end
  702. return oldAnim
  703. end
  704.  
  705. function setAnimationSpeed(speed)
  706. if speed ~= currentAnimSpeed then
  707. currentAnimSpeed = speed
  708. currentAnimTrack:AdjustSpeed(currentAnimSpeed)
  709. end
  710. end
  711.  
  712. function keyFrameReachedFunc(frameName)
  713. if (frameName == "End") then
  714. -- print("Keyframe : ".. frameName)
  715.  
  716. local repeatAnim = currentAnim
  717.  
  718. local animSpeed = currentAnimSpeed
  719. playAnimation(repeatAnim, 0.0, Humanoid)
  720. setAnimationSpeed(animSpeed)
  721. end
  722. end
  723.  
  724. -- Preload animations
  725. function playAnimation(animName, transitionTime, humanoid)
  726.  
  727. local roll = math.random(1, animTable[animName].totalWeight)
  728. local origRoll = roll
  729. local idx = 1
  730. while (roll > animTable[animName][idx].weight) do
  731. roll = roll - animTable[animName][idx].weight
  732. idx = idx + 1
  733. end
  734. -- print(animName .. " " .. idx .. " [" .. origRoll .. "]")
  735. local anim = animTable[animName][idx].anim
  736.  
  737. -- switch animation
  738. if (anim ~= currentAnimInstance) then
  739.  
  740. if (currentAnimTrack ~= nil) then
  741. currentAnimTrack:Stop(transitionTime)
  742. currentAnimTrack:Destroy()
  743. end
  744.  
  745. currentAnimSpeed = 1.0
  746.  
  747. -- load it to the humanoid; get AnimationTrack
  748. currentAnimTrack = humanoid:LoadAnimation(anim)
  749.  
  750. -- play the animation
  751. currentAnimTrack:Play(transitionTime)
  752. currentAnim = animName
  753. currentAnimInstance = anim
  754.  
  755. -- set up keyframe name triggers
  756. if (currentAnimKeyframeHandler ~= nil) then
  757. currentAnimKeyframeHandler:disconnect()
  758. end
  759. currentAnimKeyframeHandler = currentAnimTrack.KeyframeReached:connect(keyFrameReachedFunc)
  760.  
  761. end
  762.  
  763. end
  764.  
  765. -------------------------------------------------------------------------------------------
  766. -------------------------------------------------------------------------------------------
  767.  
  768. local toolAnimName = ""
  769. local toolAnimTrack = nil
  770. local toolAnimInstance = nil
  771. local currentToolAnimKeyframeHandler = nil
  772.  
  773. function toolKeyFrameReachedFunc(frameName)
  774. if (frameName == "End") then
  775. -- print("Keyframe : ".. frameName)
  776. playToolAnimation(toolAnimName, 0.0, Humanoid)
  777. end
  778. end
  779.  
  780.  
  781. function playToolAnimation(animName, transitionTime, humanoid)
  782.  
  783. local roll = math.random(1, animTable[animName].totalWeight)
  784. local origRoll = roll
  785. local idx = 1
  786. while (roll > animTable[animName][idx].weight) do
  787. roll = roll - animTable[animName][idx].weight
  788. idx = idx + 1
  789. end
  790. -- print(animName .. " * " .. idx .. " [" .. origRoll .. "]")
  791. local anim = animTable[animName][idx].anim
  792.  
  793. if (toolAnimInstance ~= anim) then
  794.  
  795. if (toolAnimTrack ~= nil) then
  796. toolAnimTrack:Stop()
  797. toolAnimTrack:Destroy()
  798. transitionTime = 0
  799. end
  800.  
  801. -- load it to the humanoid; get AnimationTrack
  802. toolAnimTrack = humanoid:LoadAnimation(anim)
  803.  
  804. -- play the animation
  805. toolAnimTrack:Play(transitionTime)
  806. toolAnimName = animName
  807. toolAnimInstance = anim
  808.  
  809. currentToolAnimKeyframeHandler = toolAnimTrack.KeyframeReached:connect(toolKeyFrameReachedFunc)
  810. end
  811. end
  812.  
  813. function stopToolAnimations()
  814. local oldAnim = toolAnimName
  815.  
  816. if (currentToolAnimKeyframeHandler ~= nil) then
  817. currentToolAnimKeyframeHandler:disconnect()
  818. end
  819.  
  820. toolAnimName = ""
  821. toolAnimInstance = nil
  822. if (toolAnimTrack ~= nil) then
  823. toolAnimTrack:Stop()
  824. toolAnimTrack:Destroy()
  825. toolAnimTrack = nil
  826. end
  827.  
  828.  
  829. return oldAnim
  830. end
  831.  
  832. -------------------------------------------------------------------------------------------
  833. -------------------------------------------------------------------------------------------
  834.  
  835.  
  836. function onRunning(speed)
  837. if speed>0.01 then
  838. playAnimation("walk", 0.1, Humanoid)
  839. pose = "Running"
  840. else
  841. playAnimation("idle", 0.1, Humanoid)
  842. pose = "Standing"
  843. end
  844. end
  845.  
  846. function onDied()
  847. pose = "Dead"
  848. end
  849.  
  850. function onJumping()
  851. playAnimation("jump", 0.1, Humanoid)
  852. jumpAnimTime = jumpAnimDuration
  853. pose = "Jumping"
  854. end
  855.  
  856. function onClimbing(speed)
  857. playAnimation("climb", 0.1, Humanoid)
  858. setAnimationSpeed(speed / 12.0)
  859. pose = "Climbing"
  860. end
  861.  
  862. function onGettingUp()
  863. pose = "GettingUp"
  864. end
  865.  
  866. function onFreeFall()
  867. if (jumpAnimTime <= 0) then
  868. playAnimation("fall", fallTransitionTime, Humanoid)
  869. end
  870. pose = "FreeFall"
  871. end
  872.  
  873. function onFallingDown()
  874. pose = "FallingDown"
  875. end
  876.  
  877. function onSeated()
  878. pose = "Seated"
  879. end
  880.  
  881. function onPlatformStanding()
  882. pose = "PlatformStanding"
  883. end
  884.  
  885. function onSwimming(speed)
  886. if speed>0 then
  887. pose = "Running"
  888. else
  889. pose = "Standing"
  890. end
  891. end
  892.  
  893. function getTool()
  894. for _, kid in ipairs(Figure:GetChildren()) do
  895. if kid.className == "Tool" then return kid end
  896. end
  897. return nil
  898. end
  899.  
  900. function getToolAnim(tool)
  901. for _, c in ipairs(tool:GetChildren()) do
  902. if c.Name == "toolanim" and c.className == "StringValue" then
  903. return c
  904. end
  905. end
  906. return nil
  907. end
  908.  
  909. function animateTool()
  910.  
  911. if (toolAnim == "None") then
  912. playToolAnimation("toolnone", toolTransitionTime, Humanoid)
  913. return
  914. end
  915.  
  916. if (toolAnim == "Slash") then
  917. playToolAnimation("toolslash", 0, Humanoid)
  918. return
  919. end
  920.  
  921. if (toolAnim == "Lunge") then
  922. playToolAnimation("toollunge", 0, Humanoid)
  923. return
  924. end
  925. end
  926.  
  927. function moveSit()
  928. RightShoulder.MaxVelocity = 0.15
  929. LeftShoulder.MaxVelocity = 0.15
  930. RightShoulder:SetDesiredAngle(3.14 /2)
  931. LeftShoulder:SetDesiredAngle(-3.14 /2)
  932. RightHip:SetDesiredAngle(3.14 /2)
  933. LeftHip:SetDesiredAngle(-3.14 /2)
  934. end
  935.  
  936. local lastTick = 0
  937.  
  938. function move(time)
  939. local amplitude = 1
  940. local frequency = 1
  941. local deltaTime = time - lastTick
  942. lastTick = time
  943.  
  944. local climbFudge = 0
  945. local setAngles = false
  946.  
  947. if (jumpAnimTime > 0) then
  948. jumpAnimTime = jumpAnimTime - deltaTime
  949. end
  950.  
  951. if (pose == "FreeFall" and jumpAnimTime <= 0) then
  952. playAnimation("fall", fallTransitionTime, Humanoid)
  953. elseif (pose == "Seated") then
  954. playAnimation("sit", 0.5, Humanoid)
  955. return
  956. elseif (pose == "Running") then
  957. playAnimation("walk", 0.1, Humanoid)
  958. elseif (pose == "Dead" or pose == "GettingUp" or pose == "FallingDown" or pose == "Seated" or pose == "PlatformStanding") then
  959. -- print("Wha " .. pose)
  960. stopAllAnimations()
  961. amplitude = 0.1
  962. frequency = 1
  963. setAngles = true
  964. end
  965.  
  966. if (setAngles) then
  967. desiredAngle = amplitude * math.sin(time * frequency)
  968.  
  969. RightShoulder:SetDesiredAngle(desiredAngle + climbFudge)
  970. LeftShoulder:SetDesiredAngle(desiredAngle - climbFudge)
  971. RightHip:SetDesiredAngle(-desiredAngle)
  972. LeftHip:SetDesiredAngle(-desiredAngle)
  973. end
  974.  
  975. -- Tool Animation handling
  976. local tool = getTool()
  977. if tool then
  978.  
  979. animStringValueObject = getToolAnim(tool)
  980.  
  981. if animStringValueObject then
  982. toolAnim = animStringValueObject.Value
  983. -- message recieved, delete StringValue
  984. animStringValueObject.Parent = nil
  985. toolAnimTime = time + .3
  986. end
  987.  
  988. if time > toolAnimTime then
  989. toolAnimTime = 0
  990. toolAnim = "None"
  991. end
  992.  
  993. animateTool()
  994. else
  995. stopToolAnimations()
  996. toolAnim = "None"
  997. toolAnimInstance = nil
  998. toolAnimTime = 0
  999. end
  1000. end
  1001.  
  1002. -- connect events
  1003. Humanoid.Died:connect(onDied)
  1004. Humanoid.Running:connect(onRunning)
  1005. Humanoid.Jumping:connect(onJumping)
  1006. Humanoid.Climbing:connect(onClimbing)
  1007. Humanoid.GettingUp:connect(onGettingUp)
  1008. Humanoid.FreeFalling:connect(onFreeFall)
  1009. Humanoid.FallingDown:connect(onFallingDown)
  1010. Humanoid.Seated:connect(onSeated)
  1011. Humanoid.PlatformStanding:connect(onPlatformStanding)
  1012. Humanoid.Swimming:connect(onSwimming)
  1013.  
  1014.  
  1015. -- main program
  1016.  
  1017. local runService = game:service("RunService");
  1018.  
  1019. -- initialize to idle
  1020. playAnimation("idle", 0.1, Humanoid)
  1021. pose = "Standing"
  1022.  
  1023. while Figure.Parent~=nil do
  1024. local _, time = wait(0.1)
  1025. move(time)
  1026. end
  1027.  
  1028.  
  1029.  
  1030. end))
  1031. StringValue34.Name = "climb"
  1032. StringValue34.Parent = Script33
  1033. Animation35.Name = "ClimbAnim"
  1034. Animation35.Parent = StringValue34
  1035. Animation35.AnimationId = "http://www.roblox.com/asset/?id=180436334"
  1036. StringValue36.Name = "fall"
  1037. StringValue36.Parent = Script33
  1038. Animation37.Name = "FallAnim"
  1039. Animation37.Parent = StringValue36
  1040. Animation37.AnimationId = "http://www.roblox.com/asset/?id=180436148"
  1041. StringValue38.Name = "idle"
  1042. StringValue38.Parent = Script33
  1043. Animation39.Name = "Animation1"
  1044. Animation39.Parent = StringValue38
  1045. Animation39.AnimationId = "http://www.roblox.com/asset/?id=180435571"
  1046. NumberValue40.Name = "Weight"
  1047. NumberValue40.Parent = Animation39
  1048. NumberValue40.Value = 9
  1049. Animation41.Name = "Animation2"
  1050. Animation41.Parent = StringValue38
  1051. Animation41.AnimationId = "http://www.roblox.com/asset/?id=180435792"
  1052. NumberValue42.Name = "Weight"
  1053. NumberValue42.Parent = Animation41
  1054. NumberValue42.Value = 1
  1055. StringValue43.Name = "jump"
  1056. StringValue43.Parent = Script33
  1057. Animation44.Name = "JumpAnim"
  1058. Animation44.Parent = StringValue43
  1059. Animation44.AnimationId = "http://www.roblox.com/asset/?id=125750702"
  1060. StringValue45.Name = "run"
  1061. StringValue45.Parent = Script33
  1062. Animation46.Name = "RunAnim"
  1063. Animation46.Parent = StringValue45
  1064. Animation46.AnimationId = "http://www.roblox.com/asset/?id=180426354"
  1065. StringValue47.Name = "sit"
  1066. StringValue47.Parent = Script33
  1067. Animation48.Name = "SitAnim"
  1068. Animation48.Parent = StringValue47
  1069. Animation48.AnimationId = "http://www.roblox.com/asset/?id=178130996"
  1070. StringValue49.Name = "toolnone"
  1071. StringValue49.Parent = Script33
  1072. Animation50.Name = "ToolNoneAnim"
  1073. Animation50.Parent = StringValue49
  1074. Animation50.AnimationId = "http://www.roblox.com/asset/?id=182393478"
  1075. StringValue51.Name = "walk"
  1076. StringValue51.Parent = Script33
  1077. Animation52.Name = "WalkAnim"
  1078. Animation52.Parent = StringValue51
  1079. Animation52.AnimationId = "http://www.roblox.com/asset/?id=180426354"
  1080. Script53.Name = "Respawn"
  1081. Script53.Parent = Model0
  1082. table.insert(cors,sandbox(Script53,function()
  1083. local humanoid = script.Parent:WaitForChild("Humanoid")
  1084. local backup = script.Parent:clone()
  1085.  
  1086. humanoid.Died:connect(function ()
  1087. wait(5)
  1088. backup.Parent = workspace
  1089. if script.Parent then
  1090. script.Parent:Destroy()
  1091. end
  1092. end)
  1093.  
  1094.  
  1095.  
  1096. end))
  1097. Script54.Name = "Sound"
  1098. Script54.Parent = Model0
  1099. table.insert(cors,sandbox(Script54,function()
  1100. -- util
  1101.  
  1102. function waitForChild(parent, childName)
  1103. local child = parent:findFirstChild(childName)
  1104. if child then return child end
  1105. while true do
  1106. child = parent.ChildAdded:wait()
  1107. if child.Name==childName then return child end
  1108. end
  1109. end
  1110.  
  1111. function newSound(id)
  1112. local sound = Instance.new("Sound")
  1113. sound.SoundId = id
  1114. sound.archivable = false
  1115. sound.Parent = script.Parent.Head
  1116. return sound
  1117. end
  1118.  
  1119. -- declarations
  1120.  
  1121. local sDied = newSound("")
  1122. local sFallingDown = newSound("")
  1123. local sFreeFalling = newSound("")
  1124. local sGettingUp = newSound("")
  1125. local sJumping = newSound("")
  1126. local sRunning = newSound("rbxassetid://429934509")
  1127. sRunning.Looped = true
  1128.  
  1129. local Figure = script.Parent
  1130. local Head = waitForChild(Figure, "Head")
  1131. local Humanoid = waitForChild(Figure, "Humanoid")
  1132.  
  1133. -- functions
  1134.  
  1135. function onDied()
  1136. sDied:Play()
  1137. end
  1138.  
  1139. function onState(state, sound)
  1140. if state then
  1141. sound:Play()
  1142. else
  1143. sound:Pause()
  1144. end
  1145. end
  1146.  
  1147. function onRunning(speed)
  1148. if speed>0 then
  1149. sRunning:Play()
  1150. else
  1151. sRunning:Pause()
  1152. end
  1153. end
  1154.  
  1155. -- connect up
  1156.  
  1157. Humanoid.Died:connect(onDied)
  1158. Humanoid.Running:connect(onRunning)
  1159. Humanoid.Jumping:connect(function(state) onState(state, sJumping) end)
  1160. Humanoid.GettingUp:connect(function(state) onState(state, sGettingUp) end)
  1161. Humanoid.FreeFalling:connect(function(state) onState(state, sFreeFalling) end)
  1162. Humanoid.FallingDown:connect(function(state) onState(state, sFallingDown) end)
  1163.  
  1164. end))
  1165. Script55.Name = "Weld"
  1166. Script55.Parent = Model0
  1167. table.insert(cors,sandbox(Script55,function()
  1168. local prev
  1169. local parts = script.Parent:GetChildren()
  1170. for i = 1,#parts do
  1171. --remove any of the following parts that say "(parts[i].className == [className])" if you want to exclude that particular className type from the Weld
  1172. if ((parts[i].className == "Part") or (parts[i].className == "Handle") or (parts[i].className == "TrussPart") or (parts[i].className == "VehicleSeat") or (parts[i].className == "SkateboardPlatform")) then
  1173. if (prev ~= nil) then
  1174. local weld = Instance.new("Weld")
  1175. weld.Part0 = prev
  1176. weld.Part1 = parts[i]
  1177. weld.C0 = prev.CFrame:inverse()
  1178. weld.C1 = parts[i].CFrame:inverse()
  1179. weld.Parent = prev
  1180. parts[i].Anchored = false
  1181. end
  1182. prev = parts[i]
  1183. end
  1184. end
  1185. wait(3)
  1186.  
  1187. end))
  1188. Script56.Name = "Weld Script"
  1189. Script56.Parent = Model0
  1190. table.insert(cors,sandbox(Script56,function()
  1191. --Simply put it inside any model with bricks inside
  1192.  
  1193.  
  1194. local prev
  1195. local parts = script.Parent:GetChildren()
  1196.  
  1197. for i = 1,#parts do
  1198. if (parts[i].className == "Part") or (parts[i].className == "WedgePart") or (parts[i].className == "Seat") or (parts[i].className == "VehicleSeat") or (parts[i].className == "CornerWedgePart") or (parts[i].className == "WedgePart") or (parts[i].className == "UnionOperation") then
  1199. if (prev ~= nil)then
  1200. local weld = Instance.new("Weld")
  1201. weld.Part0 = prev
  1202. weld.Part1 = parts[i]
  1203. weld.C0 = prev.CFrame:inverse()
  1204. weld.C1 = parts[i].CFrame:inverse()
  1205. weld.Parent = prev
  1206. end
  1207. prev = parts[i]
  1208. end
  1209. end
  1210.  
  1211. --Credits to NyroKoSu and OrientalAura
  1212. end))
  1213. Part57.Name = "HumanoidRootPart"
  1214. Part57.Parent = Model0
  1215. Part57.CFrame = CFrame.new(-18.7492905, 3.00002193, 236.262543, 4.49431016e-21, -6.79974523e-22, -1, 4.72251821e-22, 1, -6.79974523e-22, 1, -4.72251821e-22, 4.49431016e-21)
  1216. Part57.Orientation = Vector3.new(0, -90, 0)
  1217. Part57.Position = Vector3.new(-18.7492905, 3.00002193, 236.262543)
  1218. Part57.Rotation = Vector3.new(0, -90, 0)
  1219. Part57.Color = Color3.new(0.152941, 0.27451, 0.176471)
  1220. Part57.Size = Vector3.new(2, 2, 1)
  1221. Part57.BottomSurface = Enum.SurfaceType.Smooth
  1222. Part57.BrickColor = BrickColor.new("Earth green")
  1223. Part57.Material = Enum.Material.WoodPlanks
  1224. Part57.TopSurface = Enum.SurfaceType.Smooth
  1225. Part57.brickColor = BrickColor.new("Earth green")
  1226. Part57.FormFactor = Enum.FormFactor.Symmetric
  1227. Part57.formFactor = Enum.FormFactor.Symmetric
  1228. Motor6D58.Name = "Root Hip"
  1229. Motor6D58.Parent = Part57
  1230. Motor6D58.MaxVelocity = 0.10000000149012
  1231. Motor6D58.C0 = CFrame.new(0, 0, 0, -1, 0, 0, 0, 0, 1, 0, 1, -0)
  1232. Motor6D58.C1 = CFrame.new(0, 0, 0, -1, 0, 0, 0, 0, 1, 0, 1, -0)
  1233. Motor6D58.Part0 = Part57
  1234. Motor6D58.Part1 = Part14
  1235. Motor6D58.part1 = Part14
  1236. SpecialMesh59.Parent = Part57
  1237. SpecialMesh59.MeshId = "rbxassetid://506632650"
  1238. SpecialMesh59.Offset = Vector3.new(0, 0.600000024, -0.300000012)
  1239. SpecialMesh59.Scale = Vector3.new(0.109999999, 0.109999999, 0.109999999)
  1240. SpecialMesh59.TextureId = "rbxassetid://506632671"
  1241. SpecialMesh59.MeshType = Enum.MeshType.FileMesh
  1242. Part60.Name = "Eye Light"
  1243. Part60.Parent = Model0
  1244. Part60.CFrame = CFrame.new(-18.6082211, 5.92569208, 236.258713, 1, 0, 0, 0, 1, -3.05623195e-42, 0, -3.05623195e-42, 1)
  1245. Part60.Position = Vector3.new(-18.6082211, 5.92569208, 236.258713)
  1246. Part60.Color = Color3.new(0.0666667, 0.0666667, 0.0666667)
  1247. Part60.Transparency = 1
  1248. Part60.Size = Vector3.new(0.180000022, 0.180000022, 0.180000022)
  1249. Part60.BottomSurface = Enum.SurfaceType.Smooth
  1250. Part60.BrickColor = BrickColor.new("Really black")
  1251. Part60.Material = Enum.Material.SmoothPlastic
  1252. Part60.TopSurface = Enum.SurfaceType.Smooth
  1253. Part60.brickColor = BrickColor.new("Really black")
  1254. Part60.Shape = Enum.PartType.Ball
  1255. BillboardGui61.Name = "LightGUI"
  1256. BillboardGui61.Parent = Part60
  1257. BillboardGui61.Size = UDim2.new(2, 0, 2, 0)
  1258. ImageLabel62.Name = "Light"
  1259. ImageLabel62.Parent = BillboardGui61
  1260. ImageLabel62.Size = UDim2.new(1, 0, 1, 0)
  1261. ImageLabel62.BackgroundColor = BrickColor.new("New Yeller")
  1262. ImageLabel62.BackgroundColor3 = Color3.new(1, 1, 0)
  1263. ImageLabel62.BackgroundTransparency = 1
  1264. ImageLabel62.BorderColor = BrickColor.new("New Yeller")
  1265. ImageLabel62.BorderColor3 = Color3.new(1, 1, 0)
  1266. ImageLabel62.Image = "rbxasset://textures/particles/sparkles_main.dds"
  1267. ImageLabel62.ImageColor3 = Color3.new(1, 0, 0)
  1268. Script63.Parent = BillboardGui61
  1269. table.insert(cors,sandbox(Script63,function()
  1270. script.Parent.Adornee = script.Parent.Parent
  1271. end))
  1272. Part64.Name = "Eye"
  1273. Part64.Parent = Model0
  1274. Part64.CFrame = CFrame.new(-18.8107071, 5.84770679, 235.769287, 1, 0, 0, 0, 1, -3.05623195e-42, 0, -3.05623195e-42, 1)
  1275. Part64.Position = Vector3.new(-18.8107071, 5.84770679, 235.769287)
  1276. Part64.Color = Color3.new(1, 0, 0)
  1277. Part64.Size = Vector3.new(0.180000022, 0.180000022, 0.180000022)
  1278. Part64.BottomSurface = Enum.SurfaceType.Smooth
  1279. Part64.BrickColor = BrickColor.new("Really red")
  1280. Part64.Material = Enum.Material.Neon
  1281. Part64.TopSurface = Enum.SurfaceType.Smooth
  1282. Part64.brickColor = BrickColor.new("Really red")
  1283. Part64.Shape = Enum.PartType.Ball
  1284. Part65.Name = "Eye"
  1285. Part65.Parent = Model0
  1286. Part65.CFrame = CFrame.new(-18.7432938, 5.92569208, 236.258713, 1, 0, 0, 0, 1, -3.05623195e-42, 0, -3.05623195e-42, 1)
  1287. Part65.Position = Vector3.new(-18.7432938, 5.92569208, 236.258713)
  1288. Part65.Color = Color3.new(1, 0, 0)
  1289. Part65.Size = Vector3.new(0.180000022, 0.180000022, 0.180000022)
  1290. Part65.BottomSurface = Enum.SurfaceType.Smooth
  1291. Part65.BrickColor = BrickColor.new("Really red")
  1292. Part65.Material = Enum.Material.Neon
  1293. Part65.TopSurface = Enum.SurfaceType.Smooth
  1294. Part65.brickColor = BrickColor.new("Really red")
  1295. Part65.Shape = Enum.PartType.Ball
  1296. Part66.Name = "Eye Light"
  1297. Part66.Parent = Model0
  1298. Part66.CFrame = CFrame.new(-18.7026634, 5.84770679, 235.769287, 1, 0, 0, 0, 1, -3.05623195e-42, 0, -3.05623195e-42, 1)
  1299. Part66.Position = Vector3.new(-18.7026634, 5.84770679, 235.769287)
  1300. Part66.Color = Color3.new(0.0666667, 0.0666667, 0.0666667)
  1301. Part66.Transparency = 1
  1302. Part66.Size = Vector3.new(0.180000022, 0.180000022, 0.180000022)
  1303. Part66.BottomSurface = Enum.SurfaceType.Smooth
  1304. Part66.BrickColor = BrickColor.new("Really black")
  1305. Part66.Material = Enum.Material.SmoothPlastic
  1306. Part66.TopSurface = Enum.SurfaceType.Smooth
  1307. Part66.brickColor = BrickColor.new("Really black")
  1308. Part66.Shape = Enum.PartType.Ball
  1309. BillboardGui67.Name = "LightGUI"
  1310. BillboardGui67.Parent = Part66
  1311. BillboardGui67.Size = UDim2.new(2, 0, 2, 0)
  1312. ImageLabel68.Name = "Light"
  1313. ImageLabel68.Parent = BillboardGui67
  1314. ImageLabel68.Size = UDim2.new(1, 0, 1, 0)
  1315. ImageLabel68.BackgroundColor = BrickColor.new("New Yeller")
  1316. ImageLabel68.BackgroundColor3 = Color3.new(1, 1, 0)
  1317. ImageLabel68.BackgroundTransparency = 1
  1318. ImageLabel68.BorderColor = BrickColor.new("New Yeller")
  1319. ImageLabel68.BorderColor3 = Color3.new(1, 1, 0)
  1320. ImageLabel68.Image = "rbxasset://textures/particles/sparkles_main.dds"
  1321. ImageLabel68.ImageColor3 = Color3.new(1, 0, 0)
  1322. Script69.Parent = BillboardGui67
  1323. table.insert(cors,sandbox(Script69,function()
  1324. script.Parent.Adornee = script.Parent.Parent
  1325. end))
  1326. Camera70.Name = "ThumbnailCamera"
  1327. Camera70.Parent = Model0
  1328. Camera70.CFrame = CFrame.new(-53.2237892, 5.91876936, -106.117729, 0.412863821, -0.0688619316, 0.90818584, -1.86264515e-09, 0.997137785, 0.0756065771, -0.910792828, -0.0312152226, 0.411682069)
  1329. Camera70.CoordinateFrame = CFrame.new(-53.2237892, 5.91876936, -106.117729, 0.412863821, -0.0688619316, 0.90818584, -1.86264515e-09, 0.997137785, 0.0756065771, -0.910792828, -0.0312152226, 0.411682069)
  1330. Camera70.Focus = CFrame.new(-55.0401611, 5.76755619, -106.941093, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  1331. Camera70.focus = CFrame.new(-55.0401611, 5.76755619, -106.941093, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  1332. for i,v in pairs(mas:GetChildren()) do
  1333. v.Parent = workspace
  1334. pcall(function() v:MakeJoints() end)
  1335. end
  1336. mas:Destroy()
  1337. for i,v in pairs(cors) do
  1338. spawn(function()
  1339. pcall(v)
  1340. end)
  1341. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement