sawgamer1

Untitled

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