Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Issue with anti exploit kick system? (Filtering Enabled)

Asked by 5 years ago

Hello, I have recently started making a new game and have ran into an issue with one of my sections of my Anti Exploit system, It appears that my code is not properly running, Ill leave it below and if someone can help me figure it out and would like to explain to me what I did wrong I would be happy.

LOCAL SCRIPT

-- Start Varibles
local player = game:GetService("Players").LocalPlayer

-- Check if player has more air than what their AirCapacity is
    if player.Air.Value > player.Capacity.Value then
    game.ReplicatedStorage.RemoteEvents.AdminEvents.Kick:FireServer(player, "exploiting air")
end

SERVER SCRIPT

-- Admin Events

Kick.OnServerEvent:connect(function(player, reason)
        player:Kick("[Server]: You have been kicked for "..reason)
end)
0
You should also double check if the capacity value hasnt been manipulated in your script inside your ananoymous function Impacthills 223 — 5y

1 answer

Log in to vote
1
Answered by
INOOBE_YT 387 Moderation Voter
5 years ago

You check the value when the player joins. This means that after you change the value, it will not update and the old value will still be there. To make it update, you will have to use the .Changed event.

-- Start Varibles
local player = game:GetService("Players").LocalPlayer

player.Air.Changed:Connect(function()
    if player.Air.Value > player.Capacity.Value then
        game.ReplicatedStorage.RemoteEvents.AdminEvents.Kick:FireServer(player, "exploiting air")
    end
end)
1
That's pointless. An exploiter can simply delete that LocalScript User#19524 175 — 5y
0
just nil it, haha i beat you incapaz maumaumaumaumaumau 98 — 5y
Ad

Answer this question