-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathanti-kick-script.lua
More file actions
32 lines (24 loc) · 1.04 KB
/
anti-kick-script.lua
File metadata and controls
32 lines (24 loc) · 1.04 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
local getgenv, getnamecallmethod, hookmetamethod, hookfunction, newcclosure, checkcaller, string_lower, string_gsub =
getgenv, getnamecallmethod, hookmetamethod, hookfunction, newcclosure, checkcaller, string.lower, string.gsub
if getgenv().AntiKickScript then
return
end
local LocalPlayer = game:GetService("Players").LocalPlayer
getgenv().AntiKickScript = {
Enabled = true,
CheckCaller = true
}
local OriginalNamecall; OriginalNamecall = hookmetamethod(game, "__namecall", newcclosure(function(...)
local instance, message = ...
local methodName = getnamecallmethod()
if getgenv().AntiKickScript.Enabled and CompareInstances(instance, LocalPlayer) and string_gsub(methodName, "^%l", string.upper) == "Kick" then
return
end
return OriginalNamecall(...)
end))
local OriginalKickFunction; OriginalKickFunction = hookfunction(LocalPlayer.Kick, function(...)
local instance, message = ...
if getgenv().AntiKickScript.Enabled and CompareInstances(instance, LocalPlayer) then
return
end
end)