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

Wait until a value is a certain value?

Asked by 5 years ago

I'm trying to create a script that stops until a NumberValue in workspace is a certain value.

Example:


game.workspace.part.transparency = 1 wait(game.workspace.value.value == 100) -- Trying to have the script stop here until the value = 100 game.workspace.part.transparency = 0

Definitely don't know how to do it, thank you in advance.

1 answer

Log in to vote
1
Answered by
Elixcore 1337 Moderation Voter
5 years ago
Edited 5 years ago

The argument for wait is a number, not a boolean value.

what you want to do is this:

workspace.part.Transparency = 1

--since this is an intvalue, 'value' will just be the number.
workspace.Value.Changed:Connect(function(value)
    if value == 100 then
    workspace.part.Transparency = 0
end)
0
Events, not polling. Fix your answer and i'll remove my -1 and accept it again User#24403 69 — 5y
0
done, I was in a rush and completely omitted the fact it was an intvalue. Elixcore 1337 — 5y
Ad

Answer this question