Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- === REMOTE HOOK (Adaptive Confidence Mode) ===
- local shootRemote : RemoteEvent? = nil
- local hookedMeta = nil
- local SEARCH_PATTERN = "shoot"
- local lastCheck = 0
- local function getRoots()
- local roots = {}
- local userFolder = Workspace:FindFirstChild(plr.Name)
- if userFolder and userFolder:FindFirstChild("Basketball") then
- table.insert(roots, userFolder.Basketball)
- end
- local iso = Workspace:FindFirstChild("isokcocs")
- if iso and iso:FindFirstChild("Basketball") then
- table.insert(roots, iso.Basketball)
- end
- local remotes = ReplicatedStorage:FindFirstChild("Remotes")
- if remotes then
- table.insert(roots, remotes)
- end
- return roots
- end
- local function findShootRemote()
- for _, root in ipairs(getRoots()) do
- for _, obj in ipairs(root:GetDescendants()) do
- if obj:IsA("RemoteEvent") and obj.Name:lower():find(SEARCH_PATTERN) then
- return obj
- end
- end
- end
- return nil
- end
- local function hookRemote(remote)
- if hookedMeta then return end
- local old
- old = hookmetamethod(game, "__namecall", function(self, ...)
- local m = getnamecallmethod()
- if m == "FireServer" and self == remote then
- local args = {...}
- if type(args[3]) == "string" and not shootKey then
- shootKey = args[3]
- notify("Captured shoot key: "..shootKey, Color3.fromRGB(0,255,100))
- end
- if type(args[5]) == "number" then
- CURRENT_POWER = args[5]
- end
- end
- return old(self, ...)
- end)
- hookedMeta = old
- shootRemote = remote
- notify("Remote locked: "..remote:GetFullName(), Color3.fromRGB(0,255,100))
- end
- -- Watch only every 0.5s to verify remote still exists
- RunService.Heartbeat:Connect(function()
- if tick() - lastCheck < 0.5 then return end
- lastCheck = tick()
- -- If the current remote no longer exists or was removed, reacquire
- if not shootRemote or not shootRemote:IsDescendantOf(game) then
- local new = findShootRemote()
- if new and new ~= shootRemote then
- hookedMeta = nil
- shootRemote = nil
- hookRemote(new)
- end
- end
- end)
Advertisement
Add Comment
Please, Sign In to add comment