Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

Issue with anti exploit kick system? (Filtering Enabled)

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)

1 comment

0

You should also double check if the capacity value hasnt been manipulated in your script inside your ananoymous function

1 answer

✓ Accepted answer

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)

2 comments

1

That's pointless. An exploiter can simply delete that LocalScript

0

just nil it, haha i beat you incapaz

This discussion is preserved as it was. New answers, comments, and votes are closed.