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

I cant figure out how t o make the wait until?!?!?

`This is what i have--wait until game.Workspace.Zombie.Humanoid.Health = 0 script.Parent.Text = "yay"

1 comment

0

wait ... until ... is not valid Lua syntax.

2 answers

Question

I cant figure out how t o make the wait until?!?!?

Whats Wrong

wait ... until ... is not valid Lua syntax.

Solution

If you want to yield the current thread until a Humanoid has died you can use the :Wait() method on the .Died signal of a humanoid.

Zombie.Humanoid.Died:Wait()

Reading Resources

https://developer.roblox.com/en-us/api-reference/event/Humanoid/Died

https://developer.roblox.com/en-us/api-reference/datatype/RBXScriptSignal

This should fix your problem!

repeat wait() until game.Workspace.Zombie.Humanoid.Health <= 0
script.Parent.Text = "yay"

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