So I'm making a robbery system, but I need it to kick you out after a certain time. I thought I could make a bool inside the player and set it to true if they're robbing the store. Although, I don't know how to scan through all the players and kick them out if they have the value set to true. Please Help!
✓ ANSWER ACCEPTED
Check if player has a boolean value set to true inside them?
1 answer
✓ Accepted answer
You could do something like this:
for i, player in pairs(game.Players:GetPlayers()) do
if player.BoolValue == true then
-- If the boolvalue inside them is true, then kick them.
player:Kick("You can give them a reason why they are kicked here.")
end
end
Hope it helped.
This discussion is preserved as it was. New answers, comments, and votes are closed.

2 comments
Works Perfectly!
Glad I could help :)