WaitForChild not working?
Okay, so pretty much...I have 2 scripts...
01 | local girl = game.Workspace.Girl 1 |
02 | local Sound = script.Sound:WaitForChild() |
03 | script.Parent.Touched:connect( function () |
05 | girl.Arm 2. Transparency = 0 |
06 | girl.Arm 1. Transparency = 0 |
07 | girl.Head.Transparency = 0 |
08 | girl.Dress.Transparency = 0 |
09 | girl.Shoe 1. Transparency = 0 |
10 | girl.Shoe 2. Transparency = 0 |
11 | girl.Leg 1. Transparency = 0 |
12 | girl.Leg 2. Transparency = 0 |
13 | girl.Hair.Transparency = 0 |
14 | girl.Head.Decal.Transparency = 0 |
16 | girl.Arm 2. Transparency = 1 |
17 | girl.Arm 1. Transparency = 1 |
18 | girl.Head.Transparency = 1 |
19 | girl.Dress.Transparency = 1 |
20 | girl.Shoe 1. Transparency = 1 |
21 | girl.Shoe 2. Transparency = 1 |
22 | girl.Leg 1. Transparency = 1 |
23 | girl.Leg 2. Transparency = 1 |
24 | girl.Hair.Transparency = 1 |
25 | girl.Head.Decal.Transparency = 1 |
26 | print ( "Jumpscare1 Part 1 of 2 success!" ) |
and
01 | local image = game.StarterGui.Jumpscare 1. Image:WaitForChild() |
02 | local Sound 2 = script.Sound 2 :WaitForChild() |
03 | local Sound 3 = script.Sound 3 :WaitForChild() |
04 | local Sound 4 = script.Sound 4 :WaitForChild() |
05 | script.Parent.Touched:connect( function () |
17 | print ( "Jumpscare1 Part 2 of 2 success!" ) |
Its for my halloween project, and for some reason WaitForChild never seems to pick up that the objects are there, so then it just waits for ever. The only error i'm getting in the output is "Argument 1 missing or nil" but its not missing OR nil...I'm really confused.
I think you can tell what the scripts doing, but pretty much, a girl pops up behind the player, it plays a sound, then a few seconds pass and its gone again. That script is then disabled to prevent repeats...
Then the second one triggers a jumpscare, sound, and then breathing and heartbeat noises. It is disabled as well.