How would I make a script, that waits 100 seconds, but also if only 1 person has an ingame boolvalue true, will skip the rest of the time, or if all the players boolvalues = false?
Assuming the BoolValue
Object is stored under Backpack
in the Player
that you want to run this test for:
wait(100) --This function yields the current thread for however many seconds you put in player = game.Players["NameOfPlayerHere"] if player.Backpack["NameOfBoolValueHere"].Value then --It's true! :) else --It's false! :( end
Notice that there are various ways to write a truth test for boolean data types in Lua, namely:
if value then
if value == true then
if value == 1 then
if value ~= false then
if value ~= 0 then
But, personally I think if value then
is the most elegant ;)