I am making a 'limited words' based game, and trying to kick a player when they have 0 points. For some reason, it wont work. Can anyone help? Here is the script;
game.Players.PlayerAdded:Connect(function(player) if player.leaderstats.Points.Value <= 0 then player:Kick("You ran out of points!") end end)
Your current code only checks if the player’s point is 0 once when they just joined. Instead try checking every time their point changes.
local Players = game:GetService('Players') Players.PlayerAdded:Connect(function(player) local pointsValue = player.leaderstats.Points pointsValue.Changed:Connect(function() if pointsValue.Value <= 0 then player:Kick('You ran out of points!') end end) end)