I have this script, did not expect it to work, and it did not. I am not really sure where to start on this one.
local children = game.Players:GetChildren()
for i = 1, #children do
if children[i].istagged.Value == true then
print(children.Name)
end
end
It prints nil, which is kind of expected. Not sure how to script this, what I want the script to do is loop through all players until it finds a player with the boolvalue that’s true, then it would et the name and that’s the person who would lose the game. But how would I find who has the boolvalue that’s set to true?
for _, player in ipairs(game.Players:GetPlayers()) do
local tag = player:FindFirstChild("istagged")
if tag then
if tag.Value then
print(player.Name
end
end
end
Use :GetPlayers() instead of :GetChildren() (in case something that isn’t a player instance is parented to the player’s service). Additionally, you don’t need to do == true, the value of the “Value” property itself will be either true or false.
Hey is there a way to check if all players in the game have their boolvalues set to true. Im trying to make it loop through all players and if ALL players have a value set to true then a gui appears but i cant get it to work for alll players only 1, please help! @ZombieCrunchUK