Advertisement
krtoowar

Untitled

Sep 9th, 2023 (edited)
237
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.43 KB | Source Code | 0 0
  1. -- // Ensure is Da Hood (put in autoexec)
  2. if (game.PlaceId ~= 2788229376) then
  3.     return
  4. end
  5.  
  6. -- // Services
  7. local ReplicatedStorage = game:GetService("ReplicatedStorage")
  8.  
  9. -- // Vars
  10. local tablefind = table.find
  11. local MainEvent = ReplicatedStorage.MainEvent
  12.  
  13. -- // Configuration
  14. local Flags = {
  15.     "CHECKER_1",
  16.     "TeleportDetect",
  17.     "OneMoreTime"
  18. }
  19.  
  20. -- // __namecall hook
  21. local __namecall
  22. __namecall = hookmetamethod(game, "__namecall", function(...)
  23.     -- // Vars
  24.     local args = {...}
  25.     local self = args[1]
  26.     local method = getnamecallmethod()
  27.  
  28.     -- // See if the game is trying to alert the server
  29.     if (method == "FireServer" and self == MainEvent and tablefind(Flags, args[2])) then
  30.         return
  31.     end
  32.  
  33.     -- // Anti Crash
  34.     if (not checkcaller() and getfenv(2).crash) then
  35.         -- // Set the crash function (hooking can cause stutters)
  36.         local fenv = getfenv(2)
  37.         fenv.crash = function() end
  38.         setfenv(2, fenv)
  39.     end
  40.  
  41.     -- //
  42.     return __namecall(...)
  43. end)
  44.  
  45. -- // __newindex hook (stops game from setting ws/jp)
  46. local __newindex
  47. __newindex = hookmetamethod(game, "__newindex", function(t, k, v)
  48.     -- // Make sure it's trying to set our humanoid's ws/jp
  49.     if (not checkcaller() and t:IsA("Humanoid") and (k == "WalkSpeed" or k == "JumpPower")) then
  50.         -- // Disallow the set
  51.         return
  52.     end
  53.  
  54.     -- //
  55.     return __newindex(t, k, v)
  56. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement