I have this script that teleport people to a block and I have made a seperate script that puts a boolvalue into the character and can be turned on or off with a gui, How would I check to see if the boolvalue is true or false?
_G.StartingPlaces = {"StartingPlaceOne","StartingPlaceTwo","StartingPlaceThree","StartingPlaceFour","StartingPlaceFive","StartingPlaceSix"} for LoadGlobalTable = 1,#_G.StartingPlaces do print(_G.StartingPlaces[LoadGlobalTable].."Loaded") end while true do for timewait = 25, 0, -1 do wait(1) game.Workspace.Timer.SurfaceGui.Time.Text = timewait end game.Workspace.Timer.SurfaceGui.Time.Text = "Time" -- s = game.Workspace.Spawns p = game.Players:GetChildren() for PlayerTeleport = 1, #p do --Where it teleports, so where it needs to decide if the value is true or not if game.Workspace:FindFirstChild(p[PlayerTeleport].Name) then p[PlayerTeleport].Character.Torso.CFrame = s[_G.StartingPlaces[math.random(1,#_G.StartingPlaces)]].CFrame * CFrame.new(0,8,0) end script.Parent.NumberOfPeopleInGame.Value = #p script.Parent.PeopleInGame.SurfaceGui.PeopleInGame.Text = "People in game:"..#p end end
You can easily do so with an if statement.
if p[PlayerTeleport.Name].bool.Value==true then --whatever here end
You could also not write ==true because by default if statements check booleans
if p[PlayerTeleport.Name].bool.Value==true then --whatever here end
If you want it to check when its false, you could use "else" or do:
if p[PlayerTeleport.Name].bool.Value==false then --whatever here end
or
if not p[PlayerTeleport.Name].bool.Value then --whatever here end
Hopethis helped.