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

How do I use the WaitForChild() function correctly in this script?

Asked by 7 years ago
Edited 7 years ago

I'm trying to make a script that changes the value of the script's parent, a number value, to whatever the player's 'Mana' is. But apparently, I'm not doing this correctly, please help?

The Script is in a NumberValue in StarterPack, here it is:

while wait() do
script.Parent.Value = script.Parent.Parent.Parent.PlayerGui:WaitForChild("HealtGui").Mana.Value
end

I put a Game GUI that shows the stats of the player, like Heath and Mana. The thing is, the Game GUI appears after the player clicks 'Continue'. That's why I added in that 'WaitForChild', to wait for the Game GUI that I placed in the StaterGui.

0
If you are doing it correctly, why ask for help? thesit123 509 — 7y
0
Sorry, I forgot to put the 'not', Lol. sactman64 7 — 7y
0
Did you spell "Health" correctly? It shows "HealtGui" on the script. Mayk728 855 — 7y
0
That's what I called the gui sactman64 7 — 7y
View all comments (2 more)
0
what does the output says? script LOOKS fine for me. Astralyst 389 — 7y
0
It says, "Infinite Yield possible' sactman64 7 — 7y

Answer this question