sawgamer1

Untitled

Jun 24th, 2018
152
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 60.22 KB | None | 0 0
  1. --Created with PenguinAnonymous's compiler
  2. --PenguinAnonymous is not responsible for damages caused to your game
  3. --This plugin does not remove things
  4. --PenguinAnonymous cannot be held resonsible for manual deletion for the purpose of testing
  5. --Keep in mind, any items that cause errors in compilation will be skipped and documented within the last line of the disclaimer comments
  6. --Thank you for using my plugin and enjoy :)
  7. --It is free to use
  8. --If you use this plugin to create your own, please give me credit
  9. --Z_V edited my plugin to look like his own and published it without giving me credit, and that makes me very angry
  10. --Errors: ChorusSoundEffect
  11. local runDummyScript = function(f,scri)
  12. local oldenv = getfenv(f)
  13. local newenv = setmetatable({}, {
  14. __index = function(_, k)
  15. if k:lower() == 'script' then
  16. return scri
  17. else
  18. return oldenv[k]
  19. end
  20. end
  21. })
  22. setfenv(f, newenv)
  23. ypcall(function() f() end)
  24. end
  25. cors = {}
  26. mas = Instance.new("Model",game:GetService("Lighting"))
  27. mas.Name = "CompiledModel"
  28. o1 = Instance.new("Model")
  29. o2 = Instance.new("Part")
  30. o3 = Instance.new("Motor6D")
  31. o4 = Instance.new("Script")
  32. o5 = Instance.new("ScreenGui")
  33. o6 = Instance.new("Frame")
  34. o7 = Instance.new("Sound")
  35. o9 = Instance.new("Part")
  36. o10 = Instance.new("Motor6D")
  37. o11 = Instance.new("Motor6D")
  38. o12 = Instance.new("Motor6D")
  39. o13 = Instance.new("Motor6D")
  40. o14 = Instance.new("Motor6D")
  41. o15 = Instance.new("Part")
  42. o16 = Instance.new("Part")
  43. o17 = Instance.new("Part")
  44. o18 = Instance.new("Part")
  45. o19 = Instance.new("Part")
  46. o20 = Instance.new("SpecialMesh")
  47. o21 = Instance.new("Decal")
  48. o22 = Instance.new("Decal")
  49. o23 = Instance.new("Humanoid")
  50. o24 = Instance.new("BindableEvent")
  51. o25 = Instance.new("Script")
  52. o26 = Instance.new("StringValue")
  53. o27 = Instance.new("Animation")
  54. o28 = Instance.new("StringValue")
  55. o29 = Instance.new("Animation")
  56. o30 = Instance.new("StringValue")
  57. o31 = Instance.new("Animation")
  58. o32 = Instance.new("NumberValue")
  59. o33 = Instance.new("Animation")
  60. o34 = Instance.new("NumberValue")
  61. o35 = Instance.new("StringValue")
  62. o36 = Instance.new("Animation")
  63. o37 = Instance.new("StringValue")
  64. o38 = Instance.new("Animation")
  65. o39 = Instance.new("StringValue")
  66. o40 = Instance.new("Animation")
  67. o41 = Instance.new("StringValue")
  68. o42 = Instance.new("Animation")
  69. o43 = Instance.new("StringValue")
  70. o44 = Instance.new("Animation")
  71. o45 = Instance.new("Script")
  72. o46 = Instance.new("Animation")
  73. o47 = Instance.new("Configuration")
  74. o48 = Instance.new("NumberValue")
  75. o49 = Instance.new("BoolValue")
  76. o50 = Instance.new("BoolValue")
  77. o51 = Instance.new("Vector3Value")
  78. o52 = Instance.new("BoolValue")
  79. o53 = Instance.new("BrickColorValue")
  80. o54 = Instance.new("NumberValue")
  81. o55 = Instance.new("NumberValue")
  82. o56 = Instance.new("NumberValue")
  83. o57 = Instance.new("Configuration")
  84. o58 = Instance.new("ObjectValue")
  85. o59 = Instance.new("BindableEvent")
  86. o60 = Instance.new("BindableFunction")
  87. o61 = Instance.new("BindableEvent")
  88. o62 = Instance.new("Model")
  89. o63 = Instance.new("Part")
  90. o64 = Instance.new("Script")
  91. o65 = Instance.new("ScreenGui")
  92. o66 = Instance.new("Frame")
  93. o67 = Instance.new("ImageLabel")
  94. o68 = Instance.new("Sound")
  95. o69 = Instance.new("Script")
  96. o70 = Instance.new("Part")
  97. o71 = Instance.new("ClickDetector")
  98. o72 = Instance.new("Script")
  99. o73 = Instance.new("Script")
  100. o74 = Instance.new("ScreenGui")
  101. o75 = Instance.new("BoolValue")
  102. o76 = Instance.new("ImageLabel")
  103. o77 = Instance.new("Script")
  104. o78 = Instance.new("NumberValue")
  105. o79 = Instance.new("Sound")
  106. o80 = Instance.new("Script")
  107. o81 = Instance.new("Script")
  108. o82 = Instance.new("LocalScript")
  109. o83 = Instance.new("Configuration")
  110. o84 = Instance.new("ScreenGui")
  111. o85 = Instance.new("ImageLabel")
  112. o86 = Instance.new("Script")
  113. o87 = Instance.new("Sound")
  114. o88 = Instance.new("LocalScript")
  115. o89 = Instance.new("ObjectValue")
  116. o90 = Instance.new("LocalScript")
  117. o91 = Instance.new("ObjectValue")
  118. o92 = Instance.new("Sound")
  119. o93 = Instance.new("Sound")
  120. o94 = Instance.new("NumberValue")
  121. o95 = Instance.new("ImageLabel")
  122. o96 = Instance.new("Script")
  123. o97 = Instance.new("Sound")
  124. o98 = Instance.new("Script")
  125. o99 = Instance.new("Script")
  126. o1.Name = "Nightmare.exe"
  127. o1.Parent = mas
  128. o2.Name = "HumanoidRootPart"
  129. o2.Parent = o1
  130. o2.BrickColor = BrickColor.new("Pastel blue-green")
  131. o2.Transparency = 1
  132. o2.Position = Vector3.new(-41.9444008, 5.49799585, 94.8133926)
  133. o2.Rotation = Vector3.new(0, -5.96000004, 0)
  134. o2.FormFactor = Enum.FormFactor.Symmetric
  135. o2.Size = Vector3.new(2.33199978, 2.33199978, 1.16599989)
  136. o2.CFrame = CFrame.new(-41.9444008, 5.49799585, 94.8133926, 0.994581461, 0, -0.103895411, 0, 0.999994755, 0, 0.103895411, 0, 0.994581461)
  137. o2.BottomSurface = Enum.SurfaceType.Smooth
  138. o2.TopSurface = Enum.SurfaceType.Smooth
  139. o2.Color = Color3.new(0.623529, 0.952941, 0.913726)
  140. o2.Position = Vector3.new(-41.9444008, 5.49799585, 94.8133926)
  141. o3.Name = "Root Hip"
  142. o3.Parent = o2
  143. o3.C0 = CFrame.new(0, 0, 0, -1, 0, 0, 0, 0, 1, 0, 1, -0)
  144. o3.C1 = CFrame.new(0, 0, 0, -1, 0, 0, 0, 0, 1, 0, 1, -0)
  145. o3.Part0 = o2
  146. o3.Part1 = o9
  147. o3.MaxVelocity = 0.10000000149012
  148. o4.Name = "ScaryScript"
  149. o4.Parent = o2
  150. table.insert(cors,coroutine.create(function()
  151. wait()
  152. runDummyScript(function()
  153. Sound = script.Parent.Scream
  154. Popup = script.Parent.Popup
  155. Ready = true
  156. function onTouch(hit)
  157. local h = hit.Parent:FindFirstChild("Humanoid")
  158. if h ~= nil and Ready == true then
  159. Ready = false
  160. local plyr = game.Players:FindFirstChild(h.Parent.Name)
  161. local c = Popup:clone()
  162. c.Parent = plyr.PlayerGui
  163. script.Parent.Scream:play()
  164. wait(2)
  165. c:remove()
  166. wait(1)
  167. Ready = true
  168. end
  169. end
  170.  
  171. script.Parent.Touched:connect(onTouch)
  172.  
  173. end,o4)
  174. end))
  175. o5.Name = "Popup"
  176. o5.Parent = o2
  177. o6.Name = "BackGround"
  178. o6.Parent = o5
  179. o6.Position = UDim2.new(0,0,-0.10000000149012,0)
  180. o6.Size = UDim2.new(1.1000000238419,0,1.2000000476837,0)
  181. o6.Position = UDim2.new(0,0,-0.10000000149012,0)
  182. o6.BackgroundColor3 = Color3.new(0.109804, 0.109804, 0.109804)
  183. o6.BackgroundTransparency = 1
  184. o7.Name = "Scream"
  185. o7.Parent = o2
  186. o7.SoundId = "rbxassetid://464710503"
  187. o9.Name = "Torso"
  188. o9.Parent = o1
  189. o9.BrickColor = BrickColor.new("Pastel blue-green")
  190. o9.Position = Vector3.new(-41.9444008, 5.49799585, 94.8133926)
  191. o9.Rotation = Vector3.new(0, -5.96000004, 0)
  192. o9.FormFactor = Enum.FormFactor.Symmetric
  193. o9.Size = Vector3.new(2.33199978, 2.33199978, 1.16599989)
  194. o9.CFrame = CFrame.new(-41.9444008, 5.49799585, 94.8133926, 0.994581461, 0, -0.103895411, 0, 0.999994755, 0, 0.103895411, 0, 0.994581461)
  195. o9.BottomSurface = Enum.SurfaceType.Smooth
  196. o9.TopSurface = Enum.SurfaceType.Smooth
  197. o9.Color = Color3.new(0.623529, 0.952941, 0.913726)
  198. o9.Position = Vector3.new(-41.9444008, 5.49799585, 94.8133926)
  199. o10.Name = "Left Hip"
  200. o10.Parent = o9
  201. o10.C0 = CFrame.new(-1.16599989, -1.16599989, 0, -4.37113883e-08, 0, -1, 0, 0.99999994, 0, 1, 0, -4.37113883e-08)
  202. o10.C1 = CFrame.new(-0.582999945, 1.16599989, 0, -4.37113883e-08, 0, -1, 0, 0.99999994, 0, 1, 0, -4.37113883e-08)
  203. o10.Part0 = o9
  204. o10.Part1 = o15
  205. o10.MaxVelocity = 0.10000000149012
  206. o11.Name = "Right Hip"
  207. o11.Parent = o9
  208. o11.C0 = CFrame.new(1.16599989, -1.16599989, 0, -4.37113883e-08, 0, 1, -0, 0.99999994, 0, -1, 0, -4.37113883e-08)
  209. o11.C1 = CFrame.new(0.582999945, 1.16599989, 0, -4.37113883e-08, 0, 1, 0, 0.99999994, 0, -1, 0, -4.37113883e-08)
  210. o11.Part0 = o9
  211. o11.Part1 = o16
  212. o11.MaxVelocity = 0.10000000149012
  213. o12.Name = "Left Shoulder"
  214. o12.Parent = o9
  215. o12.C0 = CFrame.new(-1.16599989, 0.582999945, 0, -4.37113883e-08, 0, -1, 0, 0.99999994, 0, 1, 0, -4.37113883e-08)
  216. o12.C1 = CFrame.new(0.582999945, 0.582999945, 0, -4.37113883e-08, 0, -1, 0, 0.99999994, 0, 1, 0, -4.37113883e-08)
  217. o12.Part0 = o9
  218. o12.Part1 = o17
  219. o12.MaxVelocity = 0.10000000149012
  220. o13.Name = "Right Shoulder"
  221. o13.Parent = o9
  222. o13.C0 = CFrame.new(1.16599989, 0.582999945, 0, -4.37113883e-08, 0, 1, -0, 0.99999994, 0, -1, 0, -4.37113883e-08)
  223. o13.C1 = CFrame.new(-0.582999945, 0.582999945, 0, -4.37113883e-08, 0, 1, 0, 0.99999994, 0, -1, 0, -4.37113883e-08)
  224. o13.Part0 = o9
  225. o13.Part1 = o18
  226. o13.MaxVelocity = 0.10000000149012
  227. o14.Name = "Neck"
  228. o14.Parent = o9
  229. o14.C0 = CFrame.new(0, 1.16599989, 0, -1, 0, 0, 0, 0, 1, 0, 1, -0)
  230. o14.C1 = CFrame.new(0, -0.582999945, 0, -1, 0, 0, 0, 0, 1, 0, 1, -0)
  231. o14.Part0 = o9
  232. o14.Part1 = o19
  233. o14.MaxVelocity = 0.10000000149012
  234. o15.Name = "Left Leg"
  235. o15.Parent = o1
  236. o15.BrickColor = BrickColor.new("Pastel blue-green")
  237. o15.Position = Vector3.new(-42.5242424, 3.16600847, 94.7528229)
  238. o15.Rotation = Vector3.new(0, -5.96000004, 0)
  239. o15.FormFactor = Enum.FormFactor.Symmetric
  240. o15.Size = Vector3.new(1.16599989, 2.33199978, 1.16599989)
  241. o15.CFrame = CFrame.new(-42.5242424, 3.16600847, 94.7528229, 0.994581461, 0, -0.103895411, 0, 0.999994636, 0, 0.103895411, 0, 0.994581461)
  242. o15.BottomSurface = Enum.SurfaceType.Smooth
  243. o15.TopSurface = Enum.SurfaceType.Smooth
  244. o15.Color = Color3.new(0.623529, 0.952941, 0.913726)
  245. o15.Position = Vector3.new(-42.5242424, 3.16600847, 94.7528229)
  246. o16.Name = "Right Leg"
  247. o16.Parent = o1
  248. o16.BrickColor = BrickColor.new("Pastel blue-green")
  249. o16.Position = Vector3.new(-41.3645592, 3.16600847, 94.8739624)
  250. o16.Rotation = Vector3.new(0, -5.96000004, 0)
  251. o16.FormFactor = Enum.FormFactor.Symmetric
  252. o16.Size = Vector3.new(1.16599989, 2.33199978, 1.16599989)
  253. o16.CFrame = CFrame.new(-41.3645592, 3.16600847, 94.8739624, 0.994581461, 0, -0.103895411, 0, 0.999994636, 0, 0.103895411, 0, 0.994581461)
  254. o16.BottomSurface = Enum.SurfaceType.Smooth
  255. o16.TopSurface = Enum.SurfaceType.Smooth
  256. o16.Color = Color3.new(0.623529, 0.952941, 0.913726)
  257. o16.Position = Vector3.new(-41.3645592, 3.16600847, 94.8739624)
  258. o17.Name = "Left Arm"
  259. o17.Parent = o1
  260. o17.BrickColor = BrickColor.new("Pastel blue-green")
  261. o17.Position = Vector3.new(-43.6839218, 5.49799585, 94.6316833)
  262. o17.Rotation = Vector3.new(0, -5.96000004, 0)
  263. o17.FormFactor = Enum.FormFactor.Symmetric
  264. o17.Size = Vector3.new(1.16599989, 2.33199978, 1.16599989)
  265. o17.CFrame = CFrame.new(-43.6839218, 5.49799585, 94.6316833, 0.994581461, 0, -0.103895411, 0, 0.999994636, 0, 0.103895411, 0, 0.994581461)
  266. o17.BottomSurface = Enum.SurfaceType.Smooth
  267. o17.TopSurface = Enum.SurfaceType.Smooth
  268. o17.Color = Color3.new(0.623529, 0.952941, 0.913726)
  269. o17.Position = Vector3.new(-43.6839218, 5.49799585, 94.6316833)
  270. o18.Name = "Right Arm"
  271. o18.Parent = o1
  272. o18.BrickColor = BrickColor.new("Pastel blue-green")
  273. o18.Position = Vector3.new(-40.2048798, 5.49799585, 94.9951019)
  274. o18.Rotation = Vector3.new(0, -5.96000004, 0)
  275. o18.FormFactor = Enum.FormFactor.Symmetric
  276. o18.Size = Vector3.new(1.16599989, 2.33199978, 1.16599989)
  277. o18.CFrame = CFrame.new(-40.2048798, 5.49799585, 94.9951019, 0.994581461, 0, -0.103895411, 0, 0.999994636, 0, 0.103895411, 0, 0.994581461)
  278. o18.BottomSurface = Enum.SurfaceType.Smooth
  279. o18.TopSurface = Enum.SurfaceType.Smooth
  280. o18.Color = Color3.new(0.623529, 0.952941, 0.913726)
  281. o18.Position = Vector3.new(-40.2048798, 5.49799585, 94.9951019)
  282. o19.Name = "Head"
  283. o19.Parent = o1
  284. o19.BrickColor = BrickColor.new("Pastel blue-green")
  285. o19.Position = Vector3.new(-41.9444008, 7.24698639, 94.8133926)
  286. o19.Rotation = Vector3.new(0, -5.96000004, 0)
  287. o19.FormFactor = Enum.FormFactor.Symmetric
  288. o19.Size = Vector3.new(2.33199978, 1.16599989, 1.16599989)
  289. o19.CFrame = CFrame.new(-41.9444008, 7.24698639, 94.8133926, 0.994581461, 0, -0.103895411, 0, 0.999994755, 0, 0.103895411, 0, 0.994581461)
  290. o19.BottomSurface = Enum.SurfaceType.Smooth
  291. o19.TopSurface = Enum.SurfaceType.Smooth
  292. o19.Color = Color3.new(0.623529, 0.952941, 0.913726)
  293. o19.Position = Vector3.new(-41.9444008, 7.24698639, 94.8133926)
  294. o20.Parent = o19
  295. o20.Scale = Vector3.new(1.25, 1.25, 1.25)
  296. o21.Parent = o19
  297. o21.Texture = "http://www.roblox.com/asset/?id=291716137"
  298. o21.Face = Enum.NormalId.Left
  299. o22.Parent = o19
  300. o22.Texture = "http://www.roblox.com/asset/?id=291716137"
  301. o23.Parent = o1
  302. o23.DisplayDistanceType = Enum.HumanoidDisplayDistanceType.None
  303. o23.NameOcclusion = Enum.NameOcclusion.NoOcclusion
  304. o23.RightLeg = o16
  305. o23.LeftLeg = o15
  306. o23.Torso = o2
  307. o23.Health = 170
  308. o23.MaxHealth = 170
  309. o23.WalkSpeed = 20
  310. o24.Name = "Attacked"
  311. o24.Parent = o1
  312. o25.Name = "Animate"
  313. o25.Parent = o1
  314. table.insert(cors,coroutine.create(function()
  315. wait()
  316. runDummyScript(function()
  317. -- This is in charge of the animations for the character. Pretty much stole it from the default character. Removed emote stuff.
  318. function waitForChild(parent, childName)
  319. local child = parent:findFirstChild(childName)
  320. if child then return child end
  321. while true do
  322. child = parent.ChildAdded:wait()
  323. if child.Name==childName then return child end
  324. end
  325. end
  326.  
  327. local Figure = script.Parent
  328. local Torso = waitForChild(Figure, "Torso")
  329. local RightShoulder = waitForChild(Torso, "Right Shoulder")
  330. local LeftShoulder = waitForChild(Torso, "Left Shoulder")
  331. local RightHip = waitForChild(Torso, "Right Hip")
  332. local LeftHip = waitForChild(Torso, "Left Hip")
  333. local Neck = waitForChild(Torso, "Neck")
  334. local Humanoid = waitForChild(Figure, "Humanoid")
  335. local pose = "Standing"
  336.  
  337. local currentAnim = ""
  338. local currentAnimInstance = nil
  339. local currentAnimTrack = nil
  340. local currentAnimKeyframeHandler = nil
  341. local currentAnimSpeed = 1.0
  342. local animTable = {}
  343. local animNames = {
  344. idle = {
  345. { id = "http://www.roblox.com/asset/?id=180435571", weight = 9 },
  346. { id = "http://www.roblox.com/asset/?id=180435792", weight = 1 }
  347. },
  348. walk = {
  349. { id = "http://www.roblox.com/asset/?id=180426354", weight = 10 }
  350. },
  351. run = {
  352. { id = "run.xml", weight = 10 }
  353. },
  354. jump = {
  355. { id = "http://www.roblox.com/asset/?id=125750702", weight = 10 }
  356. },
  357. fall = {
  358. { id = "http://www.roblox.com/asset/?id=180436148", weight = 10 }
  359. },
  360. climb = {
  361. { id = "http://www.roblox.com/asset/?id=180436334", weight = 10 }
  362. },
  363. sit = {
  364. { id = "http://www.roblox.com/asset/?id=178130996", weight = 10 }
  365. },
  366. toolnone = {
  367. { id = "http://www.roblox.com/asset/?id=182393478", weight = 10 }
  368. },
  369. toolslash = {
  370. { id = "http://www.roblox.com/asset/?id=129967390", weight = 10 }
  371. -- { id = "slash.xml", weight = 10 }
  372. },
  373. toollunge = {
  374. { id = "http://www.roblox.com/asset/?id=129967478", weight = 10 }
  375. },
  376. wave = {
  377. { id = "http://www.roblox.com/asset/?id=128777973", weight = 10 }
  378. },
  379. point = {
  380. { id = "http://www.roblox.com/asset/?id=128853357", weight = 10 }
  381. },
  382. dance = {
  383. { id = "http://www.roblox.com/asset/?id=182435998", weight = 10 },
  384. { id = "http://www.roblox.com/asset/?id=182491037", weight = 10 },
  385. { id = "http://www.roblox.com/asset/?id=182491065", weight = 10 }
  386. },
  387. dance2 = {
  388. { id = "http://www.roblox.com/asset/?id=182436842", weight = 10 },
  389. { id = "http://www.roblox.com/asset/?id=182491248", weight = 10 },
  390. { id = "http://www.roblox.com/asset/?id=182491277", weight = 10 }
  391. },
  392. dance3 = {
  393. { id = "http://www.roblox.com/asset/?id=182436935", weight = 10 },
  394. { id = "http://www.roblox.com/asset/?id=182491368", weight = 10 },
  395. { id = "http://www.roblox.com/asset/?id=182491423", weight = 10 }
  396. },
  397. laugh = {
  398. { id = "http://www.roblox.com/asset/?id=129423131", weight = 10 }
  399. },
  400. cheer = {
  401. { id = "http://www.roblox.com/asset/?id=129423030", weight = 10 }
  402. },
  403. }
  404.  
  405. math.randomseed(tick())
  406.  
  407. function configureAnimationSet(name, fileList)
  408. if (animTable[name] ~= nil) then
  409. for _, connection in pairs(animTable[name].connections) do
  410. connection:disconnect()
  411. end
  412. end
  413. animTable[name] = {}
  414. animTable[name].count = 0
  415. animTable[name].totalWeight = 0
  416. animTable[name].connections = {}
  417.  
  418. -- check for config values
  419. local config = script:FindFirstChild(name)
  420. if (config ~= nil) then
  421. -- print("Loading anims " .. name)
  422. table.insert(animTable[name].connections, config.ChildAdded:connect(function(child) configureAnimationSet(name, fileList) end))
  423. table.insert(animTable[name].connections, config.ChildRemoved:connect(function(child) configureAnimationSet(name, fileList) end))
  424. local idx = 1
  425. for _, childPart in pairs(config:GetChildren()) do
  426. if (childPart:IsA("Animation")) then
  427. table.insert(animTable[name].connections, childPart.Changed:connect(function(property) configureAnimationSet(name, fileList) end))
  428. animTable[name][idx] = {}
  429. animTable[name][idx].anim = childPart
  430. local weightObject = childPart:FindFirstChild("Weight")
  431. if (weightObject == nil) then
  432. animTable[name][idx].weight = 1
  433. else
  434. animTable[name][idx].weight = weightObject.Value
  435. end
  436. animTable[name].count = animTable[name].count + 1
  437. animTable[name].totalWeight = animTable[name].totalWeight + animTable[name][idx].weight
  438. -- print(name .. " [" .. idx .. "] " .. animTable[name][idx].anim.AnimationId .. " (" .. animTable[name][idx].weight .. ")")
  439. idx = idx + 1
  440. end
  441. end
  442. end
  443.  
  444. -- fallback to defaults
  445. if (animTable[name].count <= 0) then
  446. for idx, anim in pairs(fileList) do
  447. animTable[name][idx] = {}
  448. animTable[name][idx].anim = Instance.new("Animation")
  449. animTable[name][idx].anim.Name = name
  450. animTable[name][idx].anim.AnimationId = anim.id
  451. animTable[name][idx].weight = anim.weight
  452. animTable[name].count = animTable[name].count + 1
  453. animTable[name].totalWeight = animTable[name].totalWeight + anim.weight
  454. -- print(name .. " [" .. idx .. "] " .. anim.id .. " (" .. anim.weight .. ")")
  455. end
  456. end
  457. end
  458.  
  459. -- Setup animation objects
  460. function scriptChildModified(child)
  461. local fileList = animNames[child.Name]
  462. if (fileList ~= nil) then
  463. configureAnimationSet(child.Name, fileList)
  464. end
  465. end
  466.  
  467. script.ChildAdded:connect(scriptChildModified)
  468. script.ChildRemoved:connect(scriptChildModified)
  469.  
  470.  
  471. for name, fileList in pairs(animNames) do
  472. configureAnimationSet(name, fileList)
  473. end
  474.  
  475. -- ANIMATION
  476.  
  477. -- declarations
  478. local toolAnim = "None"
  479. local toolAnimTime = 0
  480.  
  481. local jumpAnimTime = 0
  482. local jumpAnimDuration = 0.3
  483.  
  484. local toolTransitionTime = 0.1
  485. local fallTransitionTime = 0.3
  486. local jumpMaxLimbVelocity = 0.75
  487.  
  488. -- functions
  489.  
  490. function stopAllAnimations()
  491. local oldAnim = currentAnim
  492.  
  493. currentAnim = ""
  494. currentAnimInstance = nil
  495. if (currentAnimKeyframeHandler ~= nil) then
  496. currentAnimKeyframeHandler:disconnect()
  497. end
  498.  
  499. if (currentAnimTrack ~= nil) then
  500. currentAnimTrack:Stop()
  501. currentAnimTrack:Destroy()
  502. currentAnimTrack = nil
  503. end
  504. return oldAnim
  505. end
  506.  
  507. function setAnimationSpeed(speed)
  508. if speed ~= currentAnimSpeed then
  509. currentAnimSpeed = speed
  510. currentAnimTrack:AdjustSpeed(currentAnimSpeed)
  511. end
  512. end
  513.  
  514. function keyFrameReachedFunc(frameName)
  515. if (frameName == "End") then
  516. -- print("Keyframe : ".. frameName)
  517.  
  518. local repeatAnim = currentAnim
  519.  
  520. local animSpeed = currentAnimSpeed
  521. playAnimation(repeatAnim, 0.0, Humanoid)
  522. setAnimationSpeed(animSpeed)
  523. end
  524. end
  525.  
  526. -- Preload animations
  527. function playAnimation(animName, transitionTime, humanoid)
  528.  
  529. local roll = math.random(1, animTable[animName].totalWeight)
  530. local origRoll = roll
  531. local idx = 1
  532. while (roll > animTable[animName][idx].weight) do
  533. roll = roll - animTable[animName][idx].weight
  534. idx = idx + 1
  535. end
  536. -- print(animName .. " " .. idx .. " [" .. origRoll .. "]")
  537. local anim = animTable[animName][idx].anim
  538.  
  539. -- switch animation
  540. if (anim ~= currentAnimInstance) then
  541.  
  542. if (currentAnimTrack ~= nil) then
  543. currentAnimTrack:Stop(transitionTime)
  544. currentAnimTrack:Destroy()
  545. end
  546.  
  547. currentAnimSpeed = 1.0
  548.  
  549. -- load it to the humanoid; get AnimationTrack
  550. currentAnimTrack = humanoid:LoadAnimation(anim)
  551.  
  552. -- play the animation
  553. currentAnimTrack:Play(transitionTime)
  554. currentAnim = animName
  555. currentAnimInstance = anim
  556.  
  557. -- set up keyframe name triggers
  558. if (currentAnimKeyframeHandler ~= nil) then
  559. currentAnimKeyframeHandler:disconnect()
  560. end
  561. currentAnimKeyframeHandler = currentAnimTrack.KeyframeReached:connect(keyFrameReachedFunc)
  562.  
  563. end
  564.  
  565. end
  566.  
  567. -------------------------------------------------------------------------------------------
  568. -------------------------------------------------------------------------------------------
  569.  
  570. local toolAnimName = ""
  571. local toolAnimTrack = nil
  572. local toolAnimInstance = nil
  573. local currentToolAnimKeyframeHandler = nil
  574.  
  575. function toolKeyFrameReachedFunc(frameName)
  576. if (frameName == "End") then
  577. -- print("Keyframe : ".. frameName)
  578. playToolAnimation(toolAnimName, 0.0, Humanoid)
  579. end
  580. end
  581.  
  582.  
  583. function playToolAnimation(animName, transitionTime, humanoid)
  584.  
  585. local roll = math.random(1, animTable[animName].totalWeight)
  586. local origRoll = roll
  587. local idx = 1
  588. while (roll > animTable[animName][idx].weight) do
  589. roll = roll - animTable[animName][idx].weight
  590. idx = idx + 1
  591. end
  592. -- print(animName .. " * " .. idx .. " [" .. origRoll .. "]")
  593. local anim = animTable[animName][idx].anim
  594.  
  595. if (toolAnimInstance ~= anim) then
  596.  
  597. if (toolAnimTrack ~= nil) then
  598. toolAnimTrack:Stop()
  599. toolAnimTrack:Destroy()
  600. transitionTime = 0
  601. end
  602.  
  603. -- load it to the humanoid; get AnimationTrack
  604. toolAnimTrack = humanoid:LoadAnimation(anim)
  605.  
  606. -- play the animation
  607. toolAnimTrack:Play(transitionTime)
  608. toolAnimName = animName
  609. toolAnimInstance = anim
  610.  
  611. currentToolAnimKeyframeHandler = toolAnimTrack.KeyframeReached:connect(toolKeyFrameReachedFunc)
  612. end
  613. end
  614.  
  615. function stopToolAnimations()
  616. local oldAnim = toolAnimName
  617.  
  618. if (currentToolAnimKeyframeHandler ~= nil) then
  619. currentToolAnimKeyframeHandler:disconnect()
  620. end
  621.  
  622. toolAnimName = ""
  623. toolAnimInstance = nil
  624. if (toolAnimTrack ~= nil) then
  625. toolAnimTrack:Stop()
  626. toolAnimTrack:Destroy()
  627. toolAnimTrack = nil
  628. end
  629.  
  630.  
  631. return oldAnim
  632. end
  633.  
  634. -------------------------------------------------------------------------------------------
  635. -------------------------------------------------------------------------------------------
  636.  
  637.  
  638. function onRunning(speed)
  639. if speed>0.01 then
  640. playAnimation("walk", 0.1, Humanoid)
  641. pose = "Running"
  642. else
  643. playAnimation("idle", 0.1, Humanoid)
  644. pose = "Standing"
  645. end
  646. end
  647.  
  648. function onDied()
  649. pose = "Dead"
  650. end
  651.  
  652. function onJumping()
  653. playAnimation("jump", 0.1, Humanoid)
  654. jumpAnimTime = jumpAnimDuration
  655. pose = "Jumping"
  656. end
  657.  
  658. function onClimbing(speed)
  659. playAnimation("climb", 0.1, Humanoid)
  660. setAnimationSpeed(speed / 12.0)
  661. pose = "Climbing"
  662. end
  663.  
  664. function onGettingUp()
  665. pose = "GettingUp"
  666. end
  667.  
  668. function onFreeFall()
  669. if (jumpAnimTime <= 0) then
  670. playAnimation("fall", fallTransitionTime, Humanoid)
  671. end
  672. pose = "FreeFall"
  673. end
  674.  
  675. function onFallingDown()
  676. pose = "FallingDown"
  677. end
  678.  
  679. function onSeated()
  680. pose = "Seated"
  681. end
  682.  
  683. function onPlatformStanding()
  684. pose = "PlatformStanding"
  685. end
  686.  
  687. function onSwimming(speed)
  688. if speed>0 then
  689. pose = "Running"
  690. else
  691. pose = "Standing"
  692. end
  693. end
  694.  
  695. function getTool()
  696. for _, kid in ipairs(Figure:GetChildren()) do
  697. if kid.className == "Tool" then return kid end
  698. end
  699. return nil
  700. end
  701.  
  702. function getToolAnim(tool)
  703. for _, c in ipairs(tool:GetChildren()) do
  704. if c.Name == "toolanim" and c.className == "StringValue" then
  705. return c
  706. end
  707. end
  708. return nil
  709. end
  710.  
  711. function animateTool()
  712.  
  713. if (toolAnim == "None") then
  714. playToolAnimation("toolnone", toolTransitionTime, Humanoid)
  715. return
  716. end
  717.  
  718. if (toolAnim == "Slash") then
  719. playToolAnimation("toolslash", 0, Humanoid)
  720. return
  721. end
  722.  
  723. if (toolAnim == "Lunge") then
  724. playToolAnimation("toollunge", 0, Humanoid)
  725. return
  726. end
  727. end
  728.  
  729. function moveSit()
  730. RightShoulder.MaxVelocity = 0.15
  731. LeftShoulder.MaxVelocity = 0.15
  732. RightShoulder:SetDesiredAngle(3.14 /2)
  733. LeftShoulder:SetDesiredAngle(-3.14 /2)
  734. RightHip:SetDesiredAngle(3.14 /2)
  735. LeftHip:SetDesiredAngle(-3.14 /2)
  736. end
  737.  
  738. local lastTick = 0
  739.  
  740. function move(time)
  741. local amplitude = 1
  742. local frequency = 1
  743. local deltaTime = time - lastTick
  744. lastTick = time
  745.  
  746. local climbFudge = 0
  747. local setAngles = false
  748.  
  749. if (jumpAnimTime > 0) then
  750. jumpAnimTime = jumpAnimTime - deltaTime
  751. end
  752.  
  753. if (pose == "FreeFall" and jumpAnimTime <= 0) then
  754. playAnimation("fall", fallTransitionTime, Humanoid)
  755. elseif (pose == "Seated") then
  756. playAnimation("sit", 0.5, Humanoid)
  757. return
  758. elseif (pose == "Running") then
  759. playAnimation("walk", 0.1, Humanoid)
  760. elseif (pose == "Dead" or pose == "GettingUp" or pose == "FallingDown" or pose == "Seated" or pose == "PlatformStanding") then
  761. -- print("Wha " .. pose)
  762. stopAllAnimations()
  763. amplitude = 0.1
  764. frequency = 1
  765. setAngles = true
  766. end
  767.  
  768. if (setAngles) then
  769. desiredAngle = amplitude * math.sin(time * frequency)
  770.  
  771. RightShoulder:SetDesiredAngle(desiredAngle + climbFudge)
  772. LeftShoulder:SetDesiredAngle(desiredAngle - climbFudge)
  773. RightHip:SetDesiredAngle(-desiredAngle)
  774. LeftHip:SetDesiredAngle(-desiredAngle)
  775. end
  776.  
  777. -- Tool Animation handling
  778. local tool = getTool()
  779. if tool then
  780.  
  781. animStringValueObject = getToolAnim(tool)
  782.  
  783. if animStringValueObject then
  784. toolAnim = animStringValueObject.Value
  785. -- message recieved, delete StringValue
  786. animStringValueObject.Parent = nil
  787. toolAnimTime = time + .3
  788. end
  789.  
  790. if time > toolAnimTime then
  791. toolAnimTime = 0
  792. toolAnim = "None"
  793. end
  794.  
  795. animateTool()
  796. else
  797. stopToolAnimations()
  798. toolAnim = "None"
  799. toolAnimInstance = nil
  800. toolAnimTime = 0
  801. end
  802. end
  803.  
  804. -- connect events
  805. Humanoid.Died:connect(onDied)
  806. Humanoid.Running:connect(onRunning)
  807. Humanoid.Jumping:connect(onJumping)
  808. Humanoid.Climbing:connect(onClimbing)
  809. Humanoid.GettingUp:connect(onGettingUp)
  810. Humanoid.FreeFalling:connect(onFreeFall)
  811. Humanoid.FallingDown:connect(onFallingDown)
  812. Humanoid.Seated:connect(onSeated)
  813. Humanoid.PlatformStanding:connect(onPlatformStanding)
  814. Humanoid.Swimming:connect(onSwimming)
  815.  
  816.  
  817. -- main program
  818.  
  819. local runService = game:service("RunService");
  820.  
  821. -- initialize to idle
  822. playAnimation("idle", 0.1, Humanoid)
  823. pose = "Standing"
  824.  
  825. while Figure.Parent~=nil do
  826. local _, time = wait(0.1)
  827. move(time)
  828. end
  829.  
  830.  
  831.  
  832. end,o25)
  833. end))
  834. o26.Name = "climb"
  835. o26.Parent = o25
  836. o27.Name = "ClimbAnim"
  837. o27.Parent = o26
  838. o27.AnimationId = "http://www.roblox.com/asset/?id=180436334"
  839. o28.Name = "fall"
  840. o28.Parent = o25
  841. o29.Name = "FallAnim"
  842. o29.Parent = o28
  843. o29.AnimationId = "http://www.roblox.com/asset/?id=180436148"
  844. o30.Name = "idle"
  845. o30.Parent = o25
  846. o31.Name = "Animation1"
  847. o31.Parent = o30
  848. o31.AnimationId = "http://www.roblox.com/asset/?id=180435571"
  849. o32.Name = "Weight"
  850. o32.Parent = o31
  851. o32.Value = 9
  852. o33.Name = "Animation2"
  853. o33.Parent = o30
  854. o33.AnimationId = "http://www.roblox.com/asset/?id=180435792"
  855. o34.Name = "Weight"
  856. o34.Parent = o33
  857. o34.Value = 1
  858. o35.Name = "jump"
  859. o35.Parent = o25
  860. o36.Name = "JumpAnim"
  861. o36.Parent = o35
  862. o36.AnimationId = "http://www.roblox.com/asset/?id=125750702"
  863. o37.Name = "run"
  864. o37.Parent = o25
  865. o38.Name = "RunAnim"
  866. o38.Parent = o37
  867. o38.AnimationId = "http://www.roblox.com/asset/?id=180426354"
  868. o39.Name = "sit"
  869. o39.Parent = o25
  870. o40.Name = "SitAnim"
  871. o40.Parent = o39
  872. o40.AnimationId = "http://www.roblox.com/asset/?id=178130996"
  873. o41.Name = "toolnone"
  874. o41.Parent = o25
  875. o42.Name = "ToolNoneAnim"
  876. o42.Parent = o41
  877. o42.AnimationId = "http://www.roblox.com/asset/?id=182393478"
  878. o43.Name = "walk"
  879. o43.Parent = o25
  880. o44.Name = "WalkAnim"
  881. o44.Parent = o43
  882. o44.AnimationId = "http://www.roblox.com/asset/?id=180426354"
  883. o45.Name = "ZombieScript"
  884. o45.Parent = o1
  885. table.insert(cors,coroutine.create(function()
  886. wait()
  887. runDummyScript(function()
  888. --[[
  889. Basic Monster by ArceusInator
  890.  
  891. Information:
  892. Configurations.MaximumDetectionDistance (default 200)
  893. The monster will not detect players past this point. If you set it to a negative number then the monster will be able to chase from any distance.
  894.  
  895. Configurations.CanGiveUp (default true)
  896. If true, the monster will give up if its target goes past the MaximumDetectionDistance. This is a pretty good idea if you have people teleporting around.
  897.  
  898. Configurations.CanRespawn (default true)
  899. If true, the monster will respawn after it dies
  900.  
  901. Configurations.AutoDetectSpawnPoint (default true)
  902. If true, the spawn point will be auto detected based on where the monster is when it starts
  903.  
  904. Configurations.SpawnPoint (default 0,0,0)
  905. If Settings.AutoDetectSpawnPoint is disabled, this will be set to the monster's initial position. This value will be used when the monster auto respawns to tell it where to spawn next.
  906.  
  907. Configurations.FriendlyTeam (default Really black)
  908. The monster will not attack players on this team
  909.  
  910.  
  911.  
  912. Mind.CurrentTargetHumanoid (Humanoid objects only)
  913. You can force the monster to follow a certain humanoid by setting this to that humanoid
  914.  
  915.  
  916.  
  917. Monster.Respawn (Function)
  918. Arguments are: Vector3 point
  919. Info: Respawns the monster at the given point, or at the SpawnPoint setting if none if provided
  920.  
  921. Monster.Died (Event)
  922. Info: Fired when the monster dies
  923.  
  924. Monster.Respawned (Event)
  925. Info: Fired when the monster respawns
  926. --]]
  927.  
  928. local Self = script.Parent
  929. local Settings = Self:FindFirstChild'Configurations' -- Points to the settings.
  930. local Mind = Self:FindFirstChild'Mind' -- Points to the monster's mind. You can edit parts of this from other scripts in-game to change the monster's behavior. Advanced users only.
  931.  
  932. --
  933. -- Verify that everything is where it should be
  934. assert(Self:FindFirstChild'Humanoid' ~= nil, 'Monster does not have a humanoid')
  935. assert(Settings ~= nil, 'Monster does not have a Configurations object')
  936. assert(Settings:FindFirstChild'MaximumDetectionDistance' ~= nil and Settings.MaximumDetectionDistance:IsA'NumberValue', 'Monster does not have a MaximumDetectionDistance (NumberValue) setting')
  937. assert(Settings:FindFirstChild'CanGiveUp' ~= nil and Settings.CanGiveUp:IsA'BoolValue', 'Monster does not have a CanGiveUp (BoolValue) setting')
  938. assert(Settings:FindFirstChild'CanRespawn' ~= nil and Settings.CanRespawn:IsA'BoolValue', 'Monster does not have a CanRespawn (BoolValue) setting')
  939. assert(Settings:FindFirstChild'SpawnPoint' ~= nil and Settings.SpawnPoint:IsA'Vector3Value', 'Monster does not have a SpawnPoint (Vector3Value) setting')
  940. assert(Settings:FindFirstChild'AutoDetectSpawnPoint' ~= nil and Settings.AutoDetectSpawnPoint:IsA'BoolValue', 'Monster does not have a AutoDetectSpawnPoint (BoolValue) setting')
  941. assert(Settings:FindFirstChild'FriendlyTeam' ~= nil and Settings.FriendlyTeam:IsA'BrickColorValue', 'Monster does not have a FriendlyTeam (BrickColorValue) setting')
  942. assert(Settings:FindFirstChild'AttackDamage' ~= nil and Settings.AttackDamage:IsA'NumberValue', 'Monster does not have a AttackDamage (NumberValue) setting')
  943. assert(Settings:FindFirstChild'AttackFrequency' ~= nil and Settings.AttackFrequency:IsA'NumberValue', 'Monster does not have a AttackFrequency (NumberValue) setting')
  944. assert(Settings:FindFirstChild'AttackRange' ~= nil and Settings.AttackRange:IsA'NumberValue', 'Monster does not have a AttackRange (NumberValue) setting')
  945. assert(Mind ~= nil, 'Monster does not have a Mind object')
  946. assert(Mind:FindFirstChild'CurrentTargetHumanoid' ~= nil and Mind.CurrentTargetHumanoid:IsA'ObjectValue', 'Monster does not have a CurrentTargetHumanoid (ObjectValue) mind setting')
  947. assert(Self:FindFirstChild'Respawn' and Self.Respawn:IsA'BindableFunction', 'Monster does not have a Respawn BindableFunction')
  948. assert(Self:FindFirstChild'Died' and Self.Died:IsA'BindableEvent', 'Monster does not have a Died BindableEvent')
  949. assert(Self:FindFirstChild'Respawned' and Self.Died:IsA'BindableEvent', 'Monster does not have a Respawned BindableEvent')
  950. assert(Self:FindFirstChild'Attacked' and Self.Died:IsA'BindableEvent', 'Monster does not have a Attacked BindableEvent')
  951. assert(script:FindFirstChild'Attack' and script.Attack:IsA'Animation', 'Monster does not have a MonsterScript.Attack Animation')
  952.  
  953.  
  954. --
  955. --
  956. local Info = {
  957. -- These are constant values. Don't change them unless you know what you're doing.
  958.  
  959. -- Services
  960. Players = Game:GetService 'Players',
  961. PathfindingService = Game:GetService 'PathfindingService',
  962.  
  963. -- Advanced settings
  964. RecomputePathFrequency = 1, -- The monster will recompute its path this many times per second
  965. RespawnWaitTime = 5, -- How long to wait before the monster respawns
  966. JumpCheckFrequency = 1, -- How many times per second it will do a jump check
  967. }
  968. local Data = {
  969. -- These are variable values used internally by the script. Advanced users only.
  970.  
  971. LastRecomputePath = 0,
  972. Recomputing = false, -- Reocmputing occurs async, meaning this script will still run while it's happening. This variable will prevent the script from running two recomputes at once.
  973. PathCoords = {},
  974. IsDead = false,
  975. TimeOfDeath = 0,
  976. CurrentNode = nil,
  977. CurrentNodeIndex = 1,
  978. AutoRecompute = true,
  979. LastJumpCheck = 0,
  980. LastAttack = 0,
  981.  
  982. BaseMonster = Self:Clone(),
  983. AttackTrack = nil,
  984. }
  985.  
  986. --
  987. --
  988. local Monster = {} -- Create the monster class
  989.  
  990.  
  991. function Monster:GetCFrame()
  992. -- Returns the CFrame of the monster's humanoidrootpart
  993.  
  994. local humanoidRootPart = Self:FindFirstChild('HumanoidRootPart')
  995.  
  996. if humanoidRootPart ~= nil and humanoidRootPart:IsA('BasePart') then
  997. return humanoidRootPart.CFrame
  998. else
  999. return CFrame.new()
  1000. end
  1001. end
  1002.  
  1003. function Monster:GetMaximumDetectionDistance()
  1004. -- Returns the maximum detection distance
  1005.  
  1006. local setting = Settings.MaximumDetectionDistance.Value
  1007.  
  1008. if setting < 0 then
  1009. return math.huge
  1010. else
  1011. return setting
  1012. end
  1013. end
  1014.  
  1015. function Monster:SearchForTarget()
  1016. -- Finds the closest player and sets the target
  1017.  
  1018. local players = Info.Players:GetPlayers()
  1019. local closestCharacter, closestCharacterDistance
  1020.  
  1021. for i=1, #players do
  1022. local player = players[i]
  1023.  
  1024. if player.Neutral or player.TeamColor ~= Settings.FriendlyTeam.Value then
  1025. local character = player.Character
  1026.  
  1027. if character ~= nil and character:FindFirstChild('Humanoid') ~= nil and character.Humanoid:IsA('Humanoid') then
  1028. local distance = player:DistanceFromCharacter(Monster:GetCFrame().p)
  1029.  
  1030. if distance < Monster:GetMaximumDetectionDistance() then
  1031. if closestCharacter == nil then
  1032. closestCharacter, closestCharacterDistance = character, distance
  1033. else
  1034. if closestCharacterDistance > distance then
  1035. closestCharacter, closestCharacterDistance = character, distance
  1036. end
  1037. end
  1038. end
  1039. end
  1040. end
  1041. end
  1042.  
  1043.  
  1044. if closestCharacter ~= nil then
  1045. Mind.CurrentTargetHumanoid.Value = closestCharacter.Humanoid
  1046. end
  1047. end
  1048.  
  1049. function Monster:TryRecomputePath()
  1050. if Data.AutoRecompute or tick() - Data.LastRecomputePath > 1/Info.RecomputePathFrequency then
  1051. Monster:RecomputePath()
  1052. end
  1053. end
  1054.  
  1055. function Monster:GetTargetCFrame()
  1056. local targetHumanoid = Mind.CurrentTargetHumanoid.Value
  1057.  
  1058. if Monster:TargetIsValid() then
  1059. return targetHumanoid.Torso.CFrame
  1060. else
  1061. return CFrame.new()
  1062. end
  1063. end
  1064.  
  1065. function Monster:IsAlive()
  1066. return Self.Humanoid.Health > 0 and Self.Humanoid.Torso ~= nil
  1067. end
  1068.  
  1069. function Monster:TargetIsValid()
  1070. local targetHumanoid = Mind.CurrentTargetHumanoid.Value
  1071.  
  1072. if targetHumanoid ~= nil and targetHumanoid:IsA 'Humanoid' and targetHumanoid.Torso ~= nil and targetHumanoid.Torso:IsA 'BasePart' then
  1073. return true
  1074. else
  1075. return false
  1076. end
  1077. end
  1078.  
  1079. function Monster:HasClearLineOfSight()
  1080. -- Going to cast a ray to see if I can just see my target
  1081. local myPos, targetPos = Monster:GetCFrame().p, Monster:GetTargetCFrame().p
  1082.  
  1083. local hit, pos = Workspace:FindPartOnRayWithIgnoreList(
  1084. Ray.new(
  1085. myPos,
  1086. targetPos - myPos
  1087. ),
  1088. {
  1089. Self,
  1090. Mind.CurrentTargetHumanoid.Value.Parent
  1091. }
  1092. )
  1093.  
  1094.  
  1095. if hit == nil then
  1096. return true
  1097. else
  1098. return false
  1099. end
  1100. end
  1101.  
  1102. function Monster:RecomputePath()
  1103. if not Data.Recomputing then
  1104. if Monster:IsAlive() and Monster:TargetIsValid() then
  1105. if Monster:HasClearLineOfSight() then
  1106. Data.AutoRecompute = true
  1107. Data.PathCoords = {
  1108. Monster:GetCFrame().p,
  1109. Monster:GetTargetCFrame().p
  1110. }
  1111.  
  1112. Data.LastRecomputePath = tick()
  1113. Data.CurrentNode = nil
  1114. Data.CurrentNodeIndex = 2 -- Starts chasing the target without evaluating its current position
  1115. else
  1116. -- Do pathfinding since you can't walk straight
  1117. Data.Recomputing = true -- Basically a debounce.
  1118. Data.AutoRecompute = false
  1119.  
  1120.  
  1121. local path = Info.PathfindingService:ComputeSmoothPathAsync(
  1122. Monster:GetCFrame().p,
  1123. Monster:GetTargetCFrame().p,
  1124. 500
  1125. )
  1126. Data.PathCoords = path:GetPointCoordinates()
  1127.  
  1128.  
  1129. Data.Recomputing = false
  1130. Data.LastRecomputePath = tick()
  1131. Data.CurrentNode = nil
  1132. Data.CurrentNodeIndex = 1
  1133. end
  1134. end
  1135. end
  1136. end
  1137.  
  1138. function Monster:Update()
  1139. Monster:ReevaluateTarget()
  1140. Monster:SearchForTarget()
  1141. Monster:TryRecomputePath()
  1142. Monster:TravelPath()
  1143. end
  1144.  
  1145. function Monster:TravelPath()
  1146. local closest, closestDistance, closestIndex
  1147. local myPosition = Monster:GetCFrame().p
  1148. local skipCurrentNode = Data.CurrentNode ~= nil and (Data.CurrentNode - myPosition).magnitude < 3
  1149.  
  1150. for i=Data.CurrentNodeIndex, #Data.PathCoords do
  1151. local coord = Data.PathCoords[i]
  1152. if not (skipCurrentNode and coord == Data.CurrentNode) then
  1153. local distance = (coord - myPosition).magnitude
  1154.  
  1155. if closest == nil then
  1156. closest, closestDistance, closestIndex = coord, distance, i
  1157. else
  1158. if distance < closestDistance then
  1159. closest, closestDistance, closestIndex = coord, distance, i
  1160. else
  1161. break
  1162. end
  1163. end
  1164. end
  1165. end
  1166.  
  1167.  
  1168. --
  1169. if closest ~= nil then
  1170. Data.CurrentNode = closest
  1171. Data.CurrentNodeIndex = closestIndex
  1172.  
  1173. local humanoid = Self:FindFirstChild 'Humanoid'
  1174.  
  1175. if humanoid ~= nil and humanoid:IsA'Humanoid' then
  1176. humanoid:MoveTo(closest)
  1177. end
  1178.  
  1179. if Monster:IsAlive() and Monster:TargetIsValid() then
  1180. Monster:TryJumpCheck()
  1181. Monster:TryAttack()
  1182. end
  1183.  
  1184. if closestIndex == #Data.PathCoords then
  1185. -- Reached the end of the path, force a new check
  1186. Data.AutoRecompute = true
  1187. end
  1188. end
  1189. end
  1190.  
  1191. function Monster:TryJumpCheck()
  1192. if tick() - Data.LastJumpCheck > 1/Info.JumpCheckFrequency then
  1193. Monster:JumpCheck()
  1194. end
  1195. end
  1196.  
  1197. function Monster:TryAttack()
  1198. if tick() - Data.LastAttack > 1/Settings.AttackFrequency.Value then
  1199. Monster:Attack()
  1200. end
  1201. end
  1202.  
  1203. function Monster:Attack()
  1204. local myPos, targetPos = Monster:GetCFrame().p, Monster:GetTargetCFrame().p
  1205.  
  1206. if (myPos - targetPos).magnitude <= Settings.AttackRange.Value then
  1207. Mind.CurrentTargetHumanoid.Value:TakeDamage(Settings.AttackDamage.Value)
  1208. Data.LastAttack = tick()
  1209. Data.AttackTrack:Play()
  1210. end
  1211. end
  1212.  
  1213. function Monster:JumpCheck()
  1214. -- Do a raycast to check if we need to jump
  1215. local myCFrame = Monster:GetCFrame()
  1216. local checkVector = (Monster:GetTargetCFrame().p - myCFrame.p).unit*2
  1217.  
  1218. local hit, pos = Workspace:FindPartOnRay(
  1219. Ray.new(
  1220. myCFrame.p + Vector3.new(0, -2.4, 0),
  1221. checkVector
  1222. ),
  1223. Self
  1224. )
  1225.  
  1226. if hit ~= nil and not hit:IsDescendantOf(Mind.CurrentTargetHumanoid.Value.Parent) then
  1227. -- Do a slope check to make sure we're not walking up a ramp
  1228.  
  1229. local hit2, pos2 = Workspace:FindPartOnRay(
  1230. Ray.new(
  1231. myCFrame.p + Vector3.new(0, -2.3, 0),
  1232. checkVector
  1233. ),
  1234. Self
  1235. )
  1236.  
  1237. if hit2 == hit then
  1238. if ((pos2 - pos)*Vector3.new(1,0,1)).magnitude < 0.05 then -- Will pass for any ramp with <2 slope
  1239. Self.Humanoid.Jump = true
  1240. end
  1241. end
  1242. end
  1243.  
  1244. Data.LastJumpCheck = tick()
  1245. end
  1246.  
  1247. function Monster:Connect()
  1248. Mind.CurrentTargetHumanoid.Changed:connect(function(humanoid)
  1249. if humanoid ~= nil then
  1250. assert(humanoid:IsA'Humanoid', 'Monster target must be a humanoid')
  1251.  
  1252. Monster:RecomputePath()
  1253. end
  1254. end)
  1255.  
  1256. Self.Respawn.OnInvoke = function(point)
  1257. Monster:Respawn(point)
  1258. end
  1259. end
  1260.  
  1261. function Monster:Initialize()
  1262. Monster:Connect()
  1263.  
  1264. if Settings.AutoDetectSpawnPoint.Value then
  1265. Settings.SpawnPoint.Value = Monster:GetCFrame().p
  1266. end
  1267. end
  1268.  
  1269. function Monster:Respawn(point)
  1270. local point = point or Settings.SpawnPoint.Value
  1271.  
  1272. for index, obj in next, Data.BaseMonster:Clone():GetChildren() do
  1273. if obj.Name == 'Configurations' or obj.Name == 'Mind' or obj.Name == 'Respawned' or obj.Name == 'Died' or obj.Name == 'MonsterScript' or obj.Name == 'Respawn' then
  1274. obj:Destroy()
  1275. else
  1276. Self[obj.Name]:Destroy()
  1277. obj.Parent = Self
  1278. end
  1279. end
  1280.  
  1281. Monster:InitializeUnique()
  1282.  
  1283. Self.Parent = Workspace
  1284.  
  1285. Self.HumanoidRootPart.CFrame = CFrame.new(point)
  1286. Settings.SpawnPoint.Value = point
  1287. Self.Respawned:Fire()
  1288. end
  1289.  
  1290. function Monster:InitializeUnique()
  1291. Data.AttackTrack = Self.Humanoid:LoadAnimation(script.Attack)
  1292. end
  1293.  
  1294. function Monster:ReevaluateTarget()
  1295. local currentTarget = Mind.CurrentTargetHumanoid.Value
  1296.  
  1297. if currentTarget ~= nil and currentTarget:IsA'Humanoid' then
  1298. local character = currentTarget.Parent
  1299.  
  1300. if character ~= nil then
  1301. local player = Info.Players:GetPlayerFromCharacter(character)
  1302.  
  1303. if player ~= nil then
  1304. if not player.Neutral and player.TeamColor == Settings.FriendlyTeam.Value then
  1305. Mind.CurrentTargetHumanoid.Value = nil
  1306. end
  1307. end
  1308. end
  1309.  
  1310.  
  1311. if currentTarget == Mind.CurrentTargetHumanoid.Value then
  1312. local torso = currentTarget.Torso
  1313.  
  1314. if torso ~= nil and torso:IsA 'BasePart' then
  1315. if Settings.CanGiveUp.Value and (torso.Position - Monster:GetCFrame().p).magnitude > Monster:GetMaximumDetectionDistance() then
  1316. Mind.CurrentTargetHumanoid.Value = nil
  1317. end
  1318. end
  1319. end
  1320. end
  1321. end
  1322.  
  1323. --
  1324. --
  1325. Monster:Initialize()
  1326. Monster:InitializeUnique()
  1327.  
  1328. while true do
  1329. if not Monster:IsAlive() then
  1330. if Data.IsDead == false then
  1331. Data.IsDead = true
  1332. Data.TimeOfDeath = tick()
  1333. Self.Died:Fire()
  1334. end
  1335. if Data.IsDead == true then
  1336. if tick()-Data.TimeOfDeath > Info.RespawnWaitTime then
  1337. Monster:Respawn()
  1338. end
  1339. end
  1340. end
  1341.  
  1342. if Monster:IsAlive() then
  1343. Monster:Update()
  1344. end
  1345.  
  1346. wait()
  1347. end
  1348. end,o45)
  1349. end))
  1350. o46.Name = "Attack"
  1351. o46.Parent = o45
  1352. o46.AnimationId = "rbxassetid://105211514"
  1353. o47.Name = "Configurations"
  1354. o47.Parent = o1
  1355. o48.Name = "MaximumDetectionDistance"
  1356. o48.Parent = o47
  1357. o48.Value = 200
  1358. o49.Name = "CanGiveUp"
  1359. o49.Parent = o47
  1360. o49.Value = true
  1361. o50.Name = "CanRespawn"
  1362. o50.Parent = o47
  1363. o50.Value = true
  1364. o51.Name = "SpawnPoint"
  1365. o51.Parent = o47
  1366. o52.Name = "AutoDetectSpawnPoint"
  1367. o52.Parent = o47
  1368. o52.Value = true
  1369. o53.Name = "FriendlyTeam"
  1370. o53.Parent = o47
  1371. o53.Value = BrickColor.new("Really black")
  1372. o54.Name = "AttackDamage"
  1373. o54.Parent = o47
  1374. o54.Value = 9999999999
  1375. o55.Name = "AttackFrequency"
  1376. o55.Parent = o47
  1377. o55.Value = 2
  1378. o56.Name = "AttackRange"
  1379. o56.Parent = o47
  1380. o56.Value = 3
  1381. o57.Name = "Mind"
  1382. o57.Parent = o1
  1383. o58.Name = "CurrentTargetHumanoid"
  1384. o58.Parent = o57
  1385. o59.Name = "Died"
  1386. o59.Parent = o1
  1387. o60.Name = "Respawn"
  1388. o60.Parent = o1
  1389. o61.Name = "Respawned"
  1390. o61.Parent = o1
  1391. o62.Parent = o1
  1392. o63.Name = "Popup By quicksuper"
  1393. o63.Parent = o1
  1394. o63.BrickColor = BrickColor.new("Bright red")
  1395. o63.Transparency = 1
  1396. o63.Position = Vector3.new(-41.6389313, 6.35199118, 93.7564087)
  1397. o63.Rotation = Vector3.new(0, -5.96000004, 0)
  1398. o63.Anchored = true
  1399. o63.CanCollide = false
  1400. o63.Size = Vector3.new(6, 8.40000057, 1)
  1401. o63.CFrame = CFrame.new(-41.6389313, 6.35199118, 93.7564087, 0.994581699, 0, -0.103895046, 0, 0.999994755, 0, 0.103895046, 0, 0.994581699)
  1402. o63.Color = Color3.new(0.768628, 0.156863, 0.109804)
  1403. o63.Position = Vector3.new(-41.6389313, 6.35199118, 93.7564087)
  1404. o64.Name = "ScaryScript"
  1405. o64.Parent = o63
  1406. table.insert(cors,coroutine.create(function()
  1407. wait()
  1408. runDummyScript(function()
  1409. Sound = script.Parent.Scream
  1410. Popup = script.Parent.Popup
  1411. Ready = true
  1412. function onTouch(hit)
  1413. local h = hit.Parent:FindFirstChild("Humanoid")
  1414. if h ~= nil and Ready == true then
  1415. Ready = false
  1416. local plyr = game.Players:FindFirstChild(h.Parent.Name)
  1417. local c = Popup:clone()
  1418. c.Parent = plyr.PlayerGui
  1419. script.Parent.Scream:play()
  1420. wait(2)
  1421. c:remove()
  1422. wait(1)
  1423. Ready = true
  1424. end
  1425. end
  1426.  
  1427. script.Parent.Touched:connect(onTouch)
  1428.  
  1429. end,o64)
  1430. end))
  1431. o65.Name = "Popup"
  1432. o65.Parent = o63
  1433. o66.Name = "BackGround"
  1434. o66.Parent = o65
  1435. o66.Position = UDim2.new(0,0,-0.10000000149012,0)
  1436. o66.Size = UDim2.new(1.1000000238419,0,1.2000000476837,0)
  1437. o66.Position = UDim2.new(0,0,-0.10000000149012,0)
  1438. o66.BackgroundColor3 = Color3.new(0.109804, 0.109804, 0.109804)
  1439. o66.BackgroundTransparency = 1
  1440. o67.Name = "Image"
  1441. o67.Parent = o66
  1442. o67.Position = UDim2.new(0.0010000000474975,0,0.050000000745058,0)
  1443. o67.Size = UDim2.new(1,0,1,0)
  1444. o67.Position = UDim2.new(0.0010000000474975,0,0.050000000745058,0)
  1445. o67.BackgroundColor3 = Color3.new(0, 0, 0)
  1446. o67.BackgroundTransparency = 1
  1447. o67.Image = "rbxassetid://1885215432"
  1448. o68.Name = "Scream"
  1449. o68.Parent = o63
  1450. o68.Pitch = 2
  1451. o68.SoundId = "http://www.roblox.com/asset/?id=11984351"
  1452. o68.Volume = 1
  1453. o69.Name = "Read dis."
  1454. o69.Parent = o63
  1455. table.insert(cors,coroutine.create(function()
  1456. wait()
  1457. runDummyScript(function()
  1458. --[[
  1459.  
  1460.  
  1461. How to make a pop-up by quicksuper
  1462. 1. Find my take the templete... well, go to the popup gui.
  1463.  
  1464. 2. Insert the decal on a brick.
  1465.  
  1466. 3. Click the decal and look at "Propertoes".
  1467.  
  1468. 4. Look at the "Image". Copy and paste it in the "Image"
  1469.  
  1470. 5. Enjoy it! :)
  1471.  
  1472. end,o69)
  1473. end))
  1474. o70.Parent = o1
  1475. o70.Transparency = 1
  1476. o70.Position = Vector3.new(-41.9991035, 4.86700535, 95.2486267)
  1477. o70.Rotation = Vector3.new(-180, 5.96000004, -180)
  1478. o70.Anchored = true
  1479. o70.CanCollide = false
  1480. o70.FormFactor = Enum.FormFactor.Custom
  1481. o70.Size = Vector3.new(4.62999916, 5.63000727, 2.13000083)
  1482. o70.CFrame = CFrame.new(-41.9991035, 4.86700535, 95.2486267, -0.994588256, 0, 0.103895791, 0, 1, 0, -0.103895791, 0, -0.994588256)
  1483. o70.Position = Vector3.new(-41.9991035, 4.86700535, 95.2486267)
  1484. o71.Parent = o70
  1485. o71.MaxActivationDistance = 90
  1486. o72.Name = "Script2"
  1487. o72.Parent = o70
  1488. table.insert(cors,coroutine.create(function()
  1489. wait()
  1490. runDummyScript(function()
  1491. while true do
  1492. script.Parent.CFrame = script.Parent.Parent.Torso.CFrame:inverse()
  1493. script.Parent.CFrame = script.Parent.CFrame:inverse()
  1494. wait(0)
  1495. end
  1496. end,o72)
  1497. end))
  1498. o73.Parent = o70
  1499. table.insert(cors,coroutine.create(function()
  1500. wait()
  1501. runDummyScript(function()
  1502. --SLender scripts (nausea, Static GUI's and the respawn) created by: JoLLDS
  1503. --Do not change!!!!!!!!!!!!!!!!
  1504. script.Parent.ClickDetector.MouseHoverEnter:connect(function(player)
  1505. local s = script.whoseeing:FindFirstChild(player.Name)
  1506. if s == nil then
  1507. local s = Instance.new("ObjectValue")
  1508. s.Name = player.Name
  1509. s.Parent = script.whoseeing
  1510. end
  1511. local s = player.PlayerGui:FindFirstChild("Slenderdeadscene")
  1512. if s == nil then
  1513. local sound = player:FindFirstChild("slenderlook")
  1514. if sound == nil then
  1515. local sound = script.Parent.Parent.Parent.slenderlook:Clone()
  1516. sound.Parent = player
  1517. end
  1518. local sound = player:FindFirstChild("slenderlook")
  1519. local ran = math.random(6,10)
  1520. if ran == 8 then
  1521. sound:Play()
  1522. end
  1523. local s = player.PlayerGui:FindFirstChild("Static")
  1524. if player.PlayerGui:FindFirstChild("Static") == nil then
  1525. local s = script.Static:Clone()
  1526. s.Parent = player.PlayerGui
  1527. end
  1528. if player.PlayerGui.Static.Mousleave.Value == true then
  1529. player.PlayerGui.Static.Mousleave.Value = false
  1530. end
  1531. repeat
  1532. player.PlayerGui.Static.Stage.Value = player.PlayerGui.Static.Stage.Value + 1
  1533. wait(0.5)
  1534. until player.PlayerGui.Static.Stage.Value == 10 or player.PlayerGui.Static.Mousleave.Value == true
  1535. if player.PlayerGui.Static.Stage.Value == 10 then
  1536. local f = script.Slenderdeadscene:Clone()
  1537. f.ImageLabel.Script.cameratoslender.slender.Value = script.Parent.Parent
  1538. f.Parent = player.PlayerGui
  1539. f.ImageLabel.Script.Disabled = false
  1540. local v = script.whoseeing:FindFirstChild(player.Name)
  1541. if v ~= nil then
  1542. v:remove()
  1543. end
  1544. player.PlayerGui.Static:remove()
  1545. local a = player:FindFirstChild("Slender static sound")
  1546. if a ~= nil then
  1547. a.Volume = 0
  1548. end
  1549. local s = player.Character:FindFirstChild("slenderarrivalstatic")
  1550. if s ~= nil then
  1551. s:remove()
  1552. end
  1553. game.Workspace.CurrentCamera.FieldOfView = 70
  1554. else
  1555. if player.PlayerGui.Static.Mousleave.Value == true then
  1556. repeat
  1557. player.PlayerGui.Static.Stage.Value = player.PlayerGui.Static.Stage.Value - 1
  1558. wait(0.5)
  1559. until player.PlayerGui.Static.Stage.Value == 0 or player.PlayerGui.Static.Mousleave.Value == false
  1560. if player.PlayerGui.Static.Mousleave.Value == true then
  1561. player.PlayerGui.Static:remove()
  1562. local a = player:FindFirstChild("Slender static sound")
  1563. if a ~= nil then
  1564. a.Volume = 0
  1565. end
  1566. local s = player.Character:FindFirstChild("slenderarrivalstatic")
  1567. if s ~= nil then
  1568. s:remove()
  1569. end
  1570. game.Workspace.CurrentCamera.FieldOfView = 70
  1571. end
  1572. end
  1573. end
  1574. end
  1575. end)
  1576. script.Parent.ClickDetector.MouseHoverLeave:connect(function(player)
  1577. local s = script.whoseeing:FindFirstChild(player.Name)
  1578. if s ~= nil then
  1579. s:remove()
  1580. end
  1581. if player.PlayerGui:FindFirstChild("Static") ~= nil then
  1582. local c = player.PlayerGui:GetChildren()
  1583. for i, v in pairs(c) do
  1584. if v.Name == "Static" then
  1585. v.Mousleave.Value = true
  1586. end
  1587. end
  1588. end
  1589. end)
  1590.  
  1591. function onPlayerLeaving(oldPlayer)
  1592. local s = script.whoseeing:FindFirstChild(oldPlayer.Name)
  1593. if s ~= nil then
  1594. s:remove()
  1595. end
  1596. end
  1597.  
  1598. game.Players.ChildRemoved:connect(onPlayerLeaving)
  1599. -------------------------------------
  1600. end,o73)
  1601. end))
  1602. o74.Name = "Static"
  1603. o74.Parent = o73
  1604. o75.Name = "Mousleave"
  1605. o75.Parent = o74
  1606. o76.Parent = o74
  1607. o76.Position = UDim2.new(0,0,0,-25)
  1608. o76.Size = UDim2.new(1.249999165535,0,1.249999165535,0)
  1609. o76.Position = UDim2.new(0,0,0,-25)
  1610. o76.Visible = false
  1611. o76.BackgroundColor3 = Color3.new(1, 1, 1)
  1612. o76.BackgroundTransparency = 1
  1613. o77.Parent = o76
  1614. table.insert(cors,coroutine.create(function()
  1615. wait()
  1616. runDummyScript(function()
  1617. while true do
  1618. if script.Parent.Parent.Stage.Value == 0 then
  1619. script.Parent.Image = ""
  1620. end
  1621. if script.Parent.Parent.Stage.Value == 1 then
  1622. script.Parent.Image = "http://www.roblox.com/asset/?id=143972101"
  1623. end
  1624. if script.Parent.Parent.Stage.Value == 2 then
  1625. script.Parent.Image = "http://www.roblox.com/asset/?id=143972944"
  1626. end
  1627. if script.Parent.Parent.Stage.Value == 3 then
  1628. script.Parent.Image = "http://www.roblox.com/asset/?id=143973015"
  1629. end
  1630. if script.Parent.Parent.Stage.Value == 4 then
  1631. script.Parent.Image = "http://www.roblox.com/asset/?id=143973101"
  1632. end
  1633. if script.Parent.Parent.Stage.Value == 5 then
  1634. script.Parent.Image = "http://www.roblox.com/asset/?id=143975045"
  1635. end
  1636. if script.Parent.Parent.Stage.Value == 6 then
  1637. script.Parent.Image = "http://www.roblox.com/asset/?id=143975153"
  1638. end
  1639. if script.Parent.Parent.Stage.Value == 7 then
  1640. script.Parent.Image = "http://www.roblox.com/asset/?id=143975287"
  1641. end
  1642. if script.Parent.Parent.Stage.Value == 8 then
  1643. script.Parent.Image = "http://www.roblox.com/asset/?id=143975446"
  1644. end
  1645. if script.Parent.Parent.Stage.Value == 9 then
  1646. script.Parent.Image = "http://www.roblox.com/asset/?id=143975528"
  1647. end
  1648. if script.Parent.Parent.Stage.Value == 10 then
  1649. script.Parent.Image = "http://www.roblox.com/asset/?id=143975639"
  1650. end
  1651. wait() --Your CPU can't be tired, without this, the Roblox will crash
  1652. end
  1653. end,o77)
  1654. end))
  1655. o78.Name = "Stage"
  1656. o78.Parent = o74
  1657. o79.Name = "Slender static sound"
  1658. o79.Parent = o74
  1659. o79.SoundId = "http://www.roblox.com/asset/?id=133267368"
  1660. o79.Volume = 0
  1661. o80.Parent = o79
  1662. table.insert(cors,coroutine.create(function()
  1663. wait()
  1664. runDummyScript(function()
  1665. local s = script.Parent.Parent.Parent.Parent:FindFirstChild("Slender static sound")
  1666. if s == nil then
  1667. s = script.Parent:Clone()
  1668. s.Parent = script.Parent.Parent.Parent.Parent
  1669. end
  1670. while true do
  1671. s.Volume = script.Parent.Parent.Stage.Value / 10
  1672. if s.Volume > 0.5 then
  1673. s.SoundId = "http://www.roblox.com/asset/?id=133267368"
  1674. else
  1675. s.SoundId = "http://www.roblox.com/asset/?id=132081621"
  1676. end
  1677. s:Play()
  1678. wait(0.5)
  1679. s:Stop()
  1680. end
  1681. end,o80)
  1682. end))
  1683. o81.Name = "Camera static maker"
  1684. o81.Parent = o74
  1685. table.insert(cors,coroutine.create(function()
  1686. wait()
  1687. runDummyScript(function()
  1688. while true do
  1689. script.Parent.Sound.Pitch = math.random((0.1), (0.5))
  1690. script.Parent.ImageLabel.Visible = true
  1691. wait(0.2)
  1692. local s = script.Parent.Parent.Parent.Character:FindFirstChild("slenderarrivalstatic")
  1693. if s == nil then
  1694. local s = script.Parent.slenderarrivalstatic:Clone()
  1695. s.Parent = script.Parent.Parent.Parent.Character
  1696. s.Disabled = false
  1697. end
  1698. wait(math.random(0.04, 0.06))
  1699. if math.random(3,5) == 4 then
  1700. if s ~= nil then
  1701. s:remove()
  1702. end
  1703. game.Workspace.CurrentCamera.FieldOfView = 70
  1704. end
  1705. end
  1706. end,o81)
  1707. end))
  1708. o82.Name = "slenderarrivalstatic"
  1709. o82.Parent = o74
  1710. o82.Disabled = true
  1711. table.insert(cors,coroutine.create(function()
  1712. wait()
  1713. runDummyScript(function()
  1714. while true do
  1715. game.Workspace.CurrentCamera.FieldOfView = game.Workspace.CurrentCamera.FieldOfView - math.random(10,20)
  1716. wait(0.02)
  1717. game.Workspace.CurrentCamera.FieldOfView = game.Workspace.CurrentCamera.FieldOfView + math.random(5,15)
  1718. wait(0.02)
  1719. game.Workspace.CurrentCamera.FieldOfView = game.Workspace.CurrentCamera.FieldOfView + math.random(1, 5)
  1720. wait(0.4)
  1721. end
  1722. end,o82)
  1723. end))
  1724. o83.Name = "whoseeing"
  1725. o83.Parent = o73
  1726. o84.Name = "Slenderdeadscene"
  1727. o84.Parent = o73
  1728. o85.Parent = o84
  1729. o85.Position = UDim2.new(0,0,0,-25)
  1730. o85.Size = UDim2.new(0,1750,0,900)
  1731. o85.Position = UDim2.new(0,0,0,-25)
  1732. o85.Visible = false
  1733. o85.BackgroundColor3 = Color3.new(0, 0, 0)
  1734. o85.Image = "rbxassetid://1885215432"
  1735. o86.Parent = o85
  1736. o86.Disabled = true
  1737. table.insert(cors,coroutine.create(function()
  1738. wait()
  1739. runDummyScript(function()
  1740. script.slenderlook:Play()
  1741. script.Parent.Parent.Parent.Parent.Character.Humanoid.WalkSpeed = 0
  1742. script.Parent.Parent.Parent.Parent.Character.Humanoid.WalkToPart = script.cameratoslender.slender.Value.Torso
  1743. script.died:Play()
  1744. local f = script.cameratoslender
  1745. f.Parent = script.Parent.Parent.Parent.Parent.Character
  1746. f.Disabled = false
  1747. wait(0.5)
  1748. for i = 1, 10 do
  1749. wait(0.1)
  1750. script.Parent.Parent.Stage.Value = script.Parent.Parent.Stage.Value + 1
  1751. end
  1752. script.Parent.Parent.Stage.Value = 0
  1753. script.Parent.Visible = true
  1754. wait(0.2)
  1755. script.Parent.Parent.Parent.Parent.Character.Humanoid.Health = 0
  1756. script.died:Stop()
  1757. play = false
  1758. for i = 1, 24 do
  1759. s = math.random(1,6)
  1760. if s == 1 then
  1761. if play == false then
  1762. script.static:Play()
  1763. play = true
  1764. end
  1765. script.Parent.Image = "http://www.roblox.com/asset/?id=1885215432"
  1766. end
  1767. if s == 2 then
  1768. if play == true then
  1769. script.static:Stop()
  1770. play = false
  1771. end
  1772. script.Parent.Image = "http://www.roblox.com/asset/?id=1885215432"
  1773. end
  1774. if s == 3 then
  1775. if play == false then
  1776. script.static:Play()
  1777. play = true
  1778. end
  1779. script.Parent.Image = "http://www.roblox.com/asset/?id=1885215432"
  1780. end
  1781. if s == 4 then
  1782. if play == false then
  1783. script.static:Play()
  1784. play = true
  1785. end
  1786. script.Parent.Image = "http://www.roblox.com/asset/?id=1885215432"
  1787. end
  1788. if s == 5 then
  1789. if play == false then
  1790. script.static:Play()
  1791. play = true
  1792. end
  1793. script.Parent.Image = "http://www.roblox.com/asset/?id=1885215432"
  1794. end
  1795. if s == 6 then
  1796. if play == true then
  1797. script.static:Stop()
  1798. play = false
  1799. end
  1800. script.Parent.Image = "http://www.roblox.com/asset/?id=1885215432"
  1801. end
  1802. wait(0.1)
  1803. end
  1804. script.Parent.Image = "http://www.roblox.com/asset/?id=1885215432"
  1805. script.static:Stop()
  1806. local f = script.fixcamera
  1807. f.Parent = script.Parent.Parent.Parent.Parent.Character
  1808. f.Disabled = false
  1809.  
  1810. end,o86)
  1811. end))
  1812. o87.Name = "died"
  1813. o87.Parent = o86
  1814. o87.SoundId = "http://www.roblox.com/asset/?id=131196885"
  1815. o87.Volume = 1
  1816. o88.Name = "cameratoslender"
  1817. o88.Parent = o86
  1818. o88.Disabled = true
  1819. table.insert(cors,coroutine.create(function()
  1820. wait()
  1821. runDummyScript(function()
  1822. local c = game.Workspace.CurrentCamera
  1823. game.Workspace.CurrentCamera.CameraType = "Attach"
  1824. wait()
  1825. wait()
  1826. game.Workspace.CurrentCamera.CameraSubject = script.slender.Value.Cameraa
  1827. wait()
  1828. wait()
  1829. game.Workspace.CurrentCamera.Focus = script.slender.Value.Torso -- the output window say that an error occurred here, please, do not mess here, it's working, no error was detected!
  1830. wait()
  1831. game.Workspace.CurrentCamera.FieldOfView = 55
  1832. repeat wait() until script.slender.Value == nil
  1833. local s = game.Players:FindFirstChild(script.Parent.Name)
  1834. local d = s.PlayerGui.Slenderdeadscene.ImageLabel.Script.fixcamera:clone()
  1835. d.Parent = s.Character
  1836. d.Disabled = false
  1837. end,o88)
  1838. end))
  1839. o89.Name = "slender"
  1840. o89.Parent = o88
  1841. o90.Name = "fixcamera"
  1842. o90.Parent = o86
  1843. o90.Disabled = true
  1844. table.insert(cors,coroutine.create(function()
  1845. wait()
  1846. runDummyScript(function()
  1847. game.Workspace.CurrentCamera.FieldOfView = 70
  1848. game.Workspace.CurrentCamera.CameraType = "Custom"
  1849. end,o90)
  1850. end))
  1851. o91.Name = "slender"
  1852. o91.Parent = o90
  1853. o92.Name = "slenderlook"
  1854. o92.Parent = o86
  1855. o92.SoundId = "http://www.roblox.com/asset/?id=133267726"
  1856. o92.Volume = 1
  1857. o93.Name = "static"
  1858. o93.Parent = o86
  1859. o93.SoundId = "http://www.roblox.com/asset/?id=133267368"
  1860. o93.Volume = 1
  1861. o93.Looped = true
  1862. o94.Name = "Stage"
  1863. o94.Parent = o84
  1864. o95.Name = "Static"
  1865. o95.Parent = o84
  1866. o95.Position = UDim2.new(0,0,0,-25)
  1867. o95.Size = UDim2.new(1.249999165535,0,1.249999165535,0)
  1868. o95.Position = UDim2.new(0,0,0,-25)
  1869. o95.BackgroundColor3 = Color3.new(1, 1, 1)
  1870. o95.BackgroundTransparency = 1
  1871. o96.Parent = o95
  1872. table.insert(cors,coroutine.create(function()
  1873. wait()
  1874. runDummyScript(function()
  1875. while true do
  1876. if script.Parent.Parent.Stage.Value == 0 then
  1877. script.Parent.Image = ""
  1878. end
  1879. if script.Parent.Parent.Stage.Value == 1 then
  1880. script.Parent.Image = "http://www.roblox.com/asset/?id=143972101"
  1881. end
  1882. if script.Parent.Parent.Stage.Value == 2 then
  1883. script.Parent.Image = "http://www.roblox.com/asset/?id=143972944"
  1884. end
  1885. if script.Parent.Parent.Stage.Value == 3 then
  1886. script.Parent.Image = "http://www.roblox.com/asset/?id=143973015"
  1887. end
  1888. if script.Parent.Parent.Stage.Value == 4 then
  1889. script.Parent.Image = "http://www.roblox.com/asset/?id=143973101"
  1890. end
  1891. if script.Parent.Parent.Stage.Value == 5 then
  1892. script.Parent.Image = "http://www.roblox.com/asset/?id=143975045"
  1893. end
  1894. if script.Parent.Parent.Stage.Value == 6 then
  1895. script.Parent.Image = "http://www.roblox.com/asset/?id=143975153"
  1896. end
  1897. if script.Parent.Parent.Stage.Value == 7 then
  1898. script.Parent.Image = "http://www.roblox.com/asset/?id=143975287"
  1899. end
  1900. if script.Parent.Parent.Stage.Value == 8 then
  1901. script.Parent.Image = "http://www.roblox.com/asset/?id=143975446"
  1902. end
  1903. if script.Parent.Parent.Stage.Value == 9 then
  1904. script.Parent.Image = "http://www.roblox.com/asset/?id=143975528"
  1905. end
  1906. if script.Parent.Parent.Stage.Value == 10 then
  1907. script.Parent.Image = "http://www.roblox.com/asset/?id=143975639"
  1908. end
  1909. wait() --Your CPU can't be tired, without this, the Roblox will crash
  1910. end
  1911. end,o96)
  1912. end))
  1913. o97.Name = "Slender static sound"
  1914. o97.Parent = o70
  1915. o97.SoundId = "http://www.roblox.com/asset/?id=132081621"
  1916. o97.Volume = 0
  1917. o98.Parent = o97
  1918. table.insert(cors,coroutine.create(function()
  1919. wait()
  1920. runDummyScript(function()
  1921. local s = script.Parent.Parent.Parent.Parent:FindFirstChild("Slender static sound")
  1922. if s == nil then
  1923. s = script.Parent:Clone()
  1924. s.Parent = script.Parent.Parent.Parent.Parent
  1925. end
  1926. while true do
  1927. s.Volume = script.Parent.Parent.Stage.Value / 10
  1928. if s.Volume > 0.5 then
  1929. s.SoundId = "http://www.roblox.com/asset/?id=133267368"
  1930. else
  1931. s.SoundId = "http://www.roblox.com/asset/?id=132081621"
  1932. end
  1933. s:Play()
  1934. wait(0.5)
  1935. s:Stop()
  1936. end
  1937. end,o98)
  1938. end))
  1939. o99.Name = "Deadly"
  1940. o99.Parent = o70
  1941. table.insert(cors,coroutine.create(function()
  1942. wait()
  1943. runDummyScript(function()
  1944. function onTouched(hit)
  1945. local human = hit.Parent:FindFirstChild("Body Colors")
  1946. if human ~= nil then
  1947. local player = game.Players:FindFirstChild(hit.Parent.Name)
  1948. if player == nil then
  1949. human.Health = 0
  1950. else
  1951. local gui = player.PlayerGui:FindFirstChild("Slenderdeadscene")
  1952. if gui == nil then
  1953. local f = script.Parent.Script.Slenderdeadscene:Clone()
  1954. f.ImageLabel.Script.cameratoslender.slender.Value = script.Parent.Parent
  1955. f.Parent = player.PlayerGui
  1956. f.ImageLabel.Script.Disabled = false
  1957. end
  1958. end
  1959. end
  1960. end
  1961. script.Parent.Touched:connect(onTouched)
  1962. end,o99)
  1963. end))
  1964. mas.Parent = workspace
  1965. mas:MakeJoints()
  1966. local mas1 = mas:GetChildren()
  1967. for i=1,#mas1 do
  1968. mas1[i].Parent = workspace
  1969. ypcall(function() mas1[i]:MakeJoints() end)
  1970. end
  1971. mas:Destroy()
  1972. for i=1,#cors do
  1973. coroutine.resume(cors[i])
  1974. end
  1975.  
  1976. game:GetService("Lighting").Ambient = Color3.new(0.498039, 0.498039, 0.498039)
  1977. game:GetService("Lighting").Brightness = 5
  1978. game:GetService("Lighting").ColorShift_Bottom = Color3.new(1, 1, 1)
  1979. game:GetService("Lighting").ColorShift_Top = Color3.new(1, 1, 1)
  1980. game:GetService("Lighting").GlobalShadows = true
  1981. game:GetService("Lighting").OutdoorAmbient = Color3.new(0.631373, 0.631373, 0.631373)
  1982. game:GetService("Lighting").Outlines = false
  1983. game:GetService("Lighting").GeographicLatitude = 41.733299255371
  1984. game:GetService("Lighting").TimeOfDay = "16:00:00"
  1985. game:GetService("Lighting").FogColor = Color3.new(0, -7.50588, 0)
  1986. game:GetService("Lighting").FogEnd = 1.0000000037683e+14
  1987. game:GetService("Lighting").FogStart = 0
Advertisement
Add Comment
Please, Sign In to add comment