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

Check if player has a boolean value set to true inside them?

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!

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.

2 comments

0

Works Perfectly!

0

Glad I could help :)

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