sawgamer1

Untitled

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