My two questions are if you’re making an intermission, how come people use bool values? And my last question is why are bool value so useful? Any help would be appreciated!!
A BoolValue is basically has 2 values: True and False
I guess people just find it easier to use since you can insert a BoolValue named InGame and check if the Player’s BoolValue is true or not ![]()
Here’s 1 broad example that people may use:
game.Players.PlayerAdded:Connect(function(Player)
local GameValue = Instance.new("BoolValue")
GameValue.Value = false
GameValue.Name = "InGame"
GameValue.Parent = Player
end)
Here, once a player joins we’re creating a BoolValue, setting its properties, then afterwards parenting it to the Player Object (Or game.Players.Jackscarlett) in this Instance
And assuming that we’re making a intermission system, we can do:
while wait(120) do
for _, player in pairs(game.Players:GetPlayers()) do
if player.InGame.Value == true then
player.Character.HumanoidRootPart.Position = workspace.GameArea.Spawn.Position
end
end
end
Every 2 minutes we’re checking if the Player’s InGame value (Or the BoolValue we just made) is equal to true, if it is then we can teleport that certain player! If it’s not then it’ll just continue to loop through all of the players here
That might be the best explanation I can give you, but I’m sure other people can assist you with this ![]()
I got one more question. Why are bool values so useful?
My personal guess is that it’s much more simple to use, since you’re only using 2 values and it isn’t something like a String/Num/Object Value which requires more values
oh ok. Well thank you for the help!