Karap

Door ez

Apr 5th, 2023
36
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 11.17 KB | None | 0 0
  1.  
  2. -- Constants
  3.  
  4. local REMOVE_BANANA_PEELS = true
  5. local REMOVE_JEFFTHEKILLER_HITBOX = true -- makes jeff unable to deal damage
  6. local REMOVE_GREED_RISK = true -- makes you unable to collect gold when you risk taking damage from greed
  7. local REMOVE_AMBIENCE_SOUNDS = false -- not that necessary but if you want to hear better keep it
  8. local REMOVE_EYES_DAMAGE = true -- makes eyes deal no damage
  9. local REMOVE_SCREECH = true
  10. local REMOVE_LIGHT_SHATTER = true -- makes lights not shatter from any entity moving (screech will still appear unless removed)
  11. local REMOVE_LIBRARY_DOOR = true -- you can just go past it without doing the padlock
  12.  
  13. local COMPLETE_ELEVATOR_MINIGAME = true -- elevator breaker (be ready to run)
  14. -- creates a guiding light so you know where to go
  15. local MARK_NEXT_DOOR = true
  16. local MARK_KEY_PICKUP = true
  17. local MARK_GATE_LEVER = true
  18. local MARK_HINT_BOOKS = true
  19. local MARK_ELEVATOR_BREAKER_POLES = true -- for room 100
  20.  
  21. local SPEED_BOOST_ENABLED = true
  22. local BOOST_EXTRA_WALKSPEED = 6 -- above makes you teleport back by anticheat
  23.  
  24. local CREATE_ENTITY_HINTS = true -- watch your topbar for hints when entities spawn
  25.  
  26. --- don't touch below (you can however change light properties, color is (red, green, blue) up to 255)
  27.  
  28. -- Services
  29.  
  30. local PlayersService = game:GetService("Players")
  31. local ReplicatedStorage = game:GetService("ReplicatedStorage")
  32.  
  33. -- Vars
  34.  
  35. local CurrentRooms = workspace:WaitForChild("CurrentRooms")
  36.  
  37. local LocalPlayer = PlayersService.LocalPlayer
  38.  
  39. --
  40.  
  41. local Hint, OnRemovalConnection
  42. local function HandleModels(model)
  43. task.wait()
  44.  
  45. local modelIdentifier = model.Name
  46.  
  47. if modelIdentifier == "BananaPeel" and REMOVE_BANANA_PEELS then
  48. model:Destroy()
  49. elseif modelIdentifier == "JeffTheKiller" and REMOVE_JEFFTHEKILLER_HITBOX then
  50. local knife = model:WaitForChild("Knife", 10)
  51. if not knife then
  52. return
  53. end
  54.  
  55. for _, descendant in ipairs(model:GetDescendants()) do
  56. if descendant:IsA("BasePart") then
  57. descendant.CanTouch = false
  58. descendant.CanQuery = false
  59. end
  60. end
  61. elseif (modelIdentifier == "RushMoving" or modelIdentifier == "AmbushMoving") and CREATE_ENTITY_HINTS then
  62. local function formatIdentifier(primaryPart)
  63. local entityIdentifier = primaryPart.Name
  64. return entityIdentifier == "RushNew" and string.gsub(model.Name, "Moving", "") or entityIdentifier
  65. end
  66.  
  67. local function onRemovalFunction()
  68. Hint:Destroy()
  69. Hint = nil
  70.  
  71. OnRemovalConnection = nil
  72. end
  73.  
  74. local primaryPart = model.PrimaryPart or model:FindFirstChildWhichIsA("BasePart")
  75. if not primaryPart or primaryPart.Position.Y < -1000 then -- ignore fake ones
  76. return
  77. end
  78.  
  79. local entityIdentifier = formatIdentifier(primaryPart)
  80.  
  81. if Hint and OnRemovalConnection then
  82. OnRemovalConnection:Disconnect()
  83. -- let the player know there is another entity coming right after
  84. Hint.Text = entityIdentifier.. " is coming right after! hide!!!!!"
  85. -- clear stuff up later
  86. OnRemovalConnection = model:GetPropertyChangedSignal("Parent"):Once(onRemovalFunction)
  87. return
  88. end
  89.  
  90. Hint = Instance.new("Hint")
  91. Hint.Text = entityIdentifier.. " is coming! hide!!!"
  92. Hint.Parent = workspace
  93. -- clear stuff up
  94. OnRemovalConnection = model:GetPropertyChangedSignal("Parent"):Once(onRemovalFunction)
  95. end
  96. end
  97.  
  98. local function HandleRooms(room)
  99. local currentRoomId = tonumber(room.Name)
  100. local nextRoomId = currentRoomId + 1
  101.  
  102. local nextRoomNumber = string.rep("0", 4 - #tostring(nextRoomId))..nextRoomId
  103.  
  104. local isLibrary = currentRoomId == 50
  105. local isTheEnd = not isLibrary and currentRoomId == 100
  106.  
  107. local function waitForAttribute(instance, attribute, expectedValue)
  108. local function isValid()
  109. local currentValue = instance:GetAttribute(attribute)
  110. return currentValue == expectedValue
  111. end
  112.  
  113. if isValid() then
  114. return true
  115. end
  116.  
  117. instance:GetAttributeChangedSignal(attribute):Wait()
  118.  
  119. return isValid()
  120. end
  121.  
  122. local function handleDescendant(descendant)
  123. local guidingLight = Instance.new("PointLight")
  124. if MARK_NEXT_DOOR and descendant.Name == "Door" and waitForAttribute(descendant, "RoomID", nextRoomId) then
  125. guidingLight.Range = 40
  126. guidingLight.Color = Color3.fromRGB(255, 255, 255)
  127. guidingLight.Shadows = false
  128. guidingLight.Parent = descendant:WaitForChild("Door", 5)
  129. elseif MARK_KEY_PICKUP and descendant.Name == "KeyObtain" and waitForAttribute(descendant, "LockID", nextRoomNumber) then
  130. local hitbox = descendant:WaitForChild("Hitbox", 5)
  131. local keyBase = hitbox and hitbox:WaitForChild("Key", 5)
  132. if keyBase then
  133. local hintAttachment = keyBase:WaitForChild("Attachment", 5)
  134. local hintLight = hintAttachment and hintAttachment:WaitForChild("PointLight", 5)
  135. if hintLight then
  136. hintLight.Enabled = true
  137. hintLight.Shadows = true
  138. hintLight.Range = 60
  139. hintLight.Brightness = 2
  140. end
  141. end
  142. elseif MARK_GATE_LEVER and descendant.Name == "LeverForGate" then
  143. guidingLight.Range = 60
  144. guidingLight.Color = Color3.fromRGB(0, 255, 255)
  145. guidingLight.Shadows = true
  146. guidingLight.Parent = descendant:WaitForChild("Main", 5)
  147. elseif MARK_HINT_BOOKS and descendant.Name == "LiveHintBook" then
  148. guidingLight.Range = 20
  149. guidingLight.Color = Color3.fromRGB(255, 0, 255)
  150. guidingLight.Shadows = false
  151. guidingLight.Parent = descendant:WaitForChild("Base", 5)
  152. elseif MARK_ELEVATOR_BREAKER_POLES and isTheEnd and descendant.Name == "LiveBreakerPolePickup" then
  153. local base = descendant:WaitForChild("Base", 5)
  154. local hintAttachment = base and base:WaitForChild("Attachment", 5)
  155. if hintAttachment then
  156. local hintParticle = hintAttachment:WaitForChild("HintParticle", 5)
  157. local hintLight = hintAttachment:WaitForChild("HintLight", 5)
  158. if hintParticle then
  159. hintParticle.Enabled = true
  160. end
  161. if hintLight then
  162. hintLight.Enabled = true
  163. end
  164. end
  165. end
  166. end
  167.  
  168. if REMOVE_LIBRARY_DOOR and isLibrary then
  169. task.wait()
  170.  
  171. local door = room:WaitForChild("Door", 60)
  172. if door then
  173. door:Destroy()
  174. end
  175. end
  176.  
  177. for _, descendant in ipairs(room:GetDescendants()) do
  178. task.spawn(handleDescendant, descendant)
  179. end
  180.  
  181. room.DescendantAdded:Connect(handleDescendant)
  182. end
  183.  
  184. local function HandleLoot(prompt)
  185. if not REMOVE_GREED_RISK then
  186. return
  187. end
  188.  
  189. if prompt.Name ~= "LootPrompt" or prompt.ActionText ~= "Collect" then
  190. return
  191. end
  192. -- if this isn't done script won't be able to use holdbegan signal to prevent collecting
  193. prompt.HoldDuration = 0.05
  194.  
  195. local holdBeganConnection
  196. local ancestryChangedConnection
  197.  
  198. holdBeganConnection = prompt.PromptButtonHoldBegan:Connect(function(playerWhoTriggered)
  199. if LocalPlayer ~= playerWhoTriggered or LocalPlayer:GetAttribute("Greed") ~= 6 or prompt.HoldDuration == 999999 then
  200. return
  201. end
  202.  
  203. prompt.HoldDuration = 999999
  204. -- yield until greed level changes
  205. LocalPlayer:GetAttributeChangedSignal("Greed"):Wait()
  206.  
  207. prompt.HoldDuration = 0.05
  208.  
  209. end)
  210. ancestryChangedConnection = game.AncestryChanged:Connect(function()
  211. if prompt:IsDescendantOf(CurrentRooms) then
  212. return
  213. end
  214. -- prompt was removed from workspace; these connections will only take memory
  215. holdBeganConnection:Disconnect()
  216. ancestryChangedConnection:Disconnect()
  217.  
  218. holdBeganConnection = nil
  219. ancestryChangedConnection = nil
  220. end)
  221. end
  222.  
  223. local function HandleEntities()
  224. local entitiesFolder = ReplicatedStorage:WaitForChild("Entities", 5)
  225. if not entitiesFolder then
  226. return
  227. end
  228.  
  229. if REMOVE_SCREECH then
  230. local screechModel = entitiesFolder:WaitForChild("Screech", 5)
  231. if not screechModel then
  232. return
  233. end
  234.  
  235. screechModel:Destroy()
  236. end
  237. end
  238.  
  239. local function HandleAmbience()
  240. if not REMOVE_AMBIENCE_SOUNDS then
  241. return
  242. end
  243.  
  244. local ambience_dark = workspace:WaitForChild("Ambience_Dark", 5)
  245. if ambience_dark then
  246. ambience_dark.Volume = 0
  247. end
  248.  
  249. local ambienceFolder = workspace:WaitForChild("Ambience", 5)
  250. if not ambienceFolder then
  251. return
  252. end
  253.  
  254. for _, descendant in ipairs(ambienceFolder:GetDescendants()) do
  255. if descendant.ClassName == "Sound" then
  256. descendant.Volume = 0
  257. end
  258. end
  259. end
  260.  
  261. local function HandleSpeedBoost()
  262. if not SPEED_BOOST_ENABLED then
  263. return
  264. end
  265.  
  266. local function handleCharacter(character)
  267. local humanoid = character:WaitForChild("Humanoid")
  268.  
  269. local updating = false
  270. local function updateSpeedBoost()
  271. if updating then
  272. return
  273. end
  274. -- basic debounce
  275. updating = true
  276.  
  277. humanoid:SetAttribute("SpeedBoostBehind", BOOST_EXTRA_WALKSPEED)
  278.  
  279. updating = false
  280. end
  281.  
  282. humanoid:GetAttributeChangedSignal("SpeedBoostBehind"):Connect(updateSpeedBoost)
  283.  
  284. updateSpeedBoost()
  285. end
  286. -- on revive
  287. LocalPlayer.CharacterAdded:Connect(handleCharacter)
  288.  
  289. handleCharacter(LocalPlayer.Character)
  290. end
  291.  
  292. local function HandleGameEvents()
  293. local function isValid(func)
  294. return type(func) == "function" and islclosure(func) and not is_synapse_function(func)
  295. end
  296.  
  297. local gc = getgc()
  298.  
  299. if REMOVE_LIGHT_SHATTER then
  300. for _, value in pairs(gc) do
  301. if isValid(value) then
  302. local info = debug.getinfo(value)
  303. if info.currentline == 14 and string.find(info.short_src, "Module_Events") then
  304. local functionEnvironment = getfenv(value)
  305. -- remove luau optimizations (thats necessary)
  306. setuntouched(functionEnvironment, false)
  307. -- overwrite spawn
  308. functionEnvironment.spawn = function()end
  309. break
  310. end
  311. end
  312. end
  313. end
  314. end
  315.  
  316. local function HandleRemotes()
  317. local entityInfo = ReplicatedStorage:WaitForChild("EntityInfo", 5)
  318. if not entityInfo then
  319. return
  320. end
  321.  
  322. if REMOVE_EYES_DAMAGE then
  323. local motorReplicationEvent = entityInfo:WaitForChild("MotorReplication", 5)
  324. if not motorReplicationEvent then
  325. return
  326. end
  327.  
  328. local findFirstChild = game.FindFirstChild
  329.  
  330. local originalNC
  331. originalNC = hookmetamethod(game, "__namecall", function(self, ...)
  332. if self and rawequal(self, motorReplicationEvent) then
  333. if findFirstChild(workspace, "Eyes") then
  334. local function filter(x, y, ...) -- x, y, z, crouching
  335. return x, -89 - math.random(), ...
  336. end
  337.  
  338. return originalNC(self, filter(...))
  339. end
  340. end
  341.  
  342. return originalNC(self, ...)
  343. end, true)
  344. end
  345.  
  346. if COMPLETE_ELEVATOR_MINIGAME then
  347. local engageMinigame = entityInfo:WaitForChild("EngageMinigame", 5)
  348. local elevatorBreakerFinished = entityInfo:WaitForChild("EBF", 5)
  349. if not engageMinigame or not elevatorBreakerFinished then
  350. return
  351. end
  352.  
  353. local minigameFunction
  354.  
  355. for _, connection in ipairs(getconnections(engageMinigame.OnClientEvent)) do
  356. local func = connection.Function
  357. if not func then
  358. return -- ???
  359. end
  360.  
  361. local minigame = debug.getupvalue(func, 1)
  362. -- grab minigame func
  363. if not minigameFunction and type(minigame) == "function" then
  364. minigameFunction = minigame
  365. end
  366.  
  367. connection:Disable()
  368. end
  369. -- create our own handler (i dont want to use hookfunction that much)
  370. engageMinigame.OnClientEvent:Connect(function(minigame, ...)
  371. if minigame == "ElevatorBreaker" then
  372. task.wait(20)
  373. -- mark as completed
  374. elevatorBreakerFinished:FireServer()
  375. return
  376. end
  377.  
  378. if not minigameFunction then
  379. return
  380. end
  381.  
  382. task.spawn(minigameFunction, minigame, ...)
  383. end)
  384. end
  385. end
  386.  
  387. local function SetUp()
  388. workspace.ChildAdded:Connect(HandleModels)
  389.  
  390. for _, child in ipairs(workspace:GetChildren()) do
  391. task.spawn(HandleModels, child)
  392. end
  393.  
  394. --
  395.  
  396. CurrentRooms.ChildAdded:Connect(HandleRooms)
  397.  
  398. for _, room in ipairs(CurrentRooms:GetChildren()) do
  399. task.spawn(HandleRooms, room)
  400. end
  401.  
  402. --
  403.  
  404. game.DescendantAdded:Connect(HandleLoot)
  405.  
  406. for _, descendant in ipairs(game:GetDescendants()) do
  407. task.spawn(HandleLoot, descendant)
  408. end
  409.  
  410. --
  411.  
  412. task.spawn(HandleEntities)
  413. task.spawn(HandleAmbience)
  414. task.spawn(HandleSpeedBoost)
  415. task.spawn(HandleGameEvents)
  416. task.spawn(HandleRemotes)
  417. end
  418.  
  419. SetUp()
Add Comment
Please, Sign In to add comment