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

Wait until a value is a certain value?

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

✓ Accepted answer

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)

2 comments

0

Events, not polling. Fix your answer and i'll remove my -1 and accept it again

0

done, I was in a rush and completely omitted the fact it was an intvalue.

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