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
You should also double check if the capacity value hasnt been manipulated in your script inside your ananoymous function