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

How to use repeat until? for a checker if a player is in my elevator

local ElevatorPlayers = game.ReplicatedStorage.Players.PlayerValue.Value



repeat until ElevatorPlayers == ElevatorPlayers >1
print("Sucsess")
wait(5)

ServerScriptService.ElevatorScripts.Script:5: attempt to compare number with boolean Output error

4 comments

0

What math function are you trying to do with >1?

0

the value needs to be above 1 for the script to start

0

then it should be written as "repeat until ElevatorPlayers > 1", in your script its trying to treat the boolean operator (>) as an arithmetic operator (+, -, ^, etc.) 

0

Also there is no end at the end of your loop.

1 answer

Hello, hokyboy!

repeat until works as loops that waits for a certain condition

basically,

repeat (code) until (condition)

Your script should be:

local ElevatorPlayers = game.ReplicatedStorage.Players.PlayerValue.Value



repeat wait() until ElevatorPlayers > 1 -- Don't forget waits on all loops
print("Sucsess")
wait(5)

1 comment

0

àctually, since the elevatorplayers variable is set above the loop as the current value at the time, it will never run.

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