Universal Script 📌
4.4k Views
1.1k Executions

Advanced AntiKick

Universal Script 📌
TCESTeam_IAmFriendly
TCESTeam_IAmFriendlyFirst script
1 year ago
Get an executor
Please login to perform these actions:

Does it work?

No reports yet

No reports yet. Tried it? Be the first to say.

Also noticed:

Description

Hooks Kick, Shutdown, Remove/RemoveAsync, and more, preventing from localscripts kicking the player.

View Raw
local Players = game:GetService("Players")
local localPlayer = Players.LocalPlayer
local mtGame = getrawmetatable(game)
local mtPlayers = getrawmetatable(Players)

setreadonly(mtGame, false)
setreadonly(mtPlayers, false)

-- hook __namecall for Kick, Destroy, Remove, RemoveAsync, and Shutdown
local oldNamecall = mtGame.__namecall
mtGame.__namecall = newcclosure(function(self, ...)
    local method = getnamecallmethod()
    
    if (self == localPlayer and (method == "Kick" or method == "Destroy" or method == "Remove" or method == "RemoveAsync")) or
       (self == game and method == "Shutdown") then
        print("[AntiKick] Blocked:", method)
        return "Error 403-FORBIDDEN"
    end

    return oldNamecall(self, ...)
end)

-- prevent overwriting LocalPlayer
local oldNewIndex = mtPlayers.__newindex
mtPlayers.__newindex = newcclosure(function(self, key, value)
    if self == Players and key == "LocalPlayer" then
        print("[AntiKick] Attempt to overwrite LocalPlayer blocked")
        return "Error 403-FORBIDDEN"
    end
    return oldNewIndex(self, key, value)
end)

setreadonly(mtGame, true)
setreadonly(mtPlayers, true)

print("[AntiKick] Advanced AntiKick active.")


Comments

3
Log in to join the conversation. Login
ZegHub's profile picture
ZegHub1 year ago

its looks like pretty safe

2
ZERETET's profile picture
ZERETET1 year ago

chatgpt + logger

-2
Docks's profile picture
Docks1 year ago

@ZERETET huh

2

More universal scripts

See all
Universal Script 📌
40.2k
817.4k
Bumped 1 hour ago
Universal Script 📌
133.5k
24.2k
Bumped 2 hours ago
Key System
Universal Script 📌
111
9
Approved 2 hours ago
Universal Script 📌
105
4
Approved 2 hours ago
Universal Script 📌
6.5k
118
Bumped 3 hours ago