Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local FileName = "UniversalMethodFinder"
- local finder, globalcontainer =
- loadstring(game:HttpGet("https://raw.githubusercontent.com/luau/SomeHub/main/" .. FileName .. ".luau", true), FileName)()
- -- globalcontainer can also be indexed using "local container = (getgenv and getgenv() or _G or shared).globalcontainer"
- -- Below is the example how sometimes "debug" library and other Roblox libraries might have the methods you need (usually executors add them back if Roblox removed something). You are supposed to set them before running this script aka before the loadstring. This way they will be used in case method finder does not find anything better! Pretty good isn't it.
- -- If you do use the Roblox libraries then you need to set to true the ForceSearch boolean parameter or you can assign methods a new name when using finder. If you do not wish to enable the ForceSearch parameter then you must assign them after you've used the finder and if nothing was found then assign the values from the "debug" library in this case - example for this is at the bottom of the code. If you pick this variant then you must remove the similar lines of code at the top as having both is pointless.
- if debug and debug.getmetatable then
- globalcontainer.getrawtable = debug.getmetatable
- end
- finder({
- getrawtable = '(...):find("get", nil, true) and (...):find("raw", nil, true) and (...):find("tab", nil, true)',
- gethiddenprop = '(...):find("^get") and (...):find("hid", nil, true) and (...):find("prop", nil, true)', -- An example of logical statement string that makes use of the string pattern syntax (:find("^get"), `^` being an Anchor and declaring the start of the string meaning get must be at the very start to match)
- queue_on_teleport = 'local arg1 = ({ ... })[1] local result = (arg1):find("queue", nil, true) and (arg1):find("tele", nil, true) if result and KRNL_LOADED then print("Script is being ran on KRNL, performing an extra check") result = not ((arg1):find("run", nil, true) or (arg1):find("script", nil, true)) end return result', -- An example of a complex logical statement that requires more than one of code in order to achieve the goal result which otherwise might not be possible. Usually, you wouldn't need this unless you can't fit your logical statement into one "if" line and require extra control of the matching process
- hash = 'local args = { ... } local arg1 = args[1] local arg2 = tostring(args[2]) local result = (arg2):find("crypt", nil, true) and (arg1):find("hash", nil, true) return result', -- A good example of matching by the environment name (`crypt` in this case). Be careful when matching environments as their names can have types other than string so make an if check for it or use tostring().
- }, true, nil, true) -- ForceSearch = true, PrintResults = true, generally the second one is not needed if you don't need to find the methods again for some reason. It MUST BE SET TO TRUE if you are pre-defining a fallback from Roblox library like debug (e.g. debug.getmetatable), otherwise it will not try to find anything better because the method has already been defined.
- -- If your executor supports getgenv() you could remove the part up until the dot. So only leave the function in that case.
- -- WARNING: Sometimes methods might be NOT found and therefore nil so you should check if they exist before using them!
- -- For people who don't want to use ForceSearch boolean parameter but still want to assign a fallback value in case finder didn't find anything. If you pick this variant then you must remove the similar lines of code at the top as having both is pointless.
- if not globalcontainer.getrawtable and debug and debug.getmetatable then
- globalcontainer.getrawtable = debug.getmetatable
- end
- local gm = globalcontainer.getrawtable(game)
- globalcontainer.gethiddenprop(workspace.Terrain, "Decoration", false)
- globalcontainer.queue_on_teleport('print("queue ran!")')
- --credits: luau (github)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement