Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How do you check if a number value is three?

Asked by
Yeevivor4 155
9 years ago
function checkPartsLeft()
while true do 
    local count = 0 
    local PartsLeft = Workspace.PartsLeft.Value
    if PartsLeft.Value == 3 then
        time.Value = 0 
end
end

What I am trying to do is to make a function where the game repeatedly checks if PartsLeft, which is a NumberValue, is three or less than three.

1 answer

Log in to vote
0
Answered by
Merely 2122 Moderation Voter Community Moderator
9 years ago

Use the less than or equal to operator (<=)

if PartsLeft.Value <= 3 then

The wiki has more information on operators http://wiki.roblox.com/index.php?title=Operators

Ad

Answer this question