|
| 10 Oct 2016 10:52 AM |
in
local healthScript = character:WaitForChild('Health') healthScript:Destroy() what does the method WaitForChild do?
NeutralEnergy- New scripter |
|
|
| Report Abuse |
|
|
|
| 10 Oct 2016 10:53 AM |
| it's like findfirstchild except it waits for the child if it doesn't yet exist, whereas findfirstchild would just return nil |
|
|
| Report Abuse |
|
|
|
| 10 Oct 2016 10:56 AM |
why can't the script use FindFirstChild then?
NeutralEnergy- New scripter |
|
|
| Report Abuse |
|
|
|
| 10 Oct 2016 11:06 AM |
| because the health script might not be created instantly when the character spawns, and so waitforchild prevents the script from erroring if that were to happen |
|
|
| Report Abuse |
|
|