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

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

Asked by
DJH_100 28
5 years ago

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

0
`wait ... until ...` is not valid Lua syntax. EpicMetatableMoment 1444 — 5y

2 answers

Log in to vote
3
Answered by 5 years ago
Edited 5 years ago

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

Ad
Log in to vote
0
Answered by 5 years ago

This should fix your problem!

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

Answer this question