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

Attempt to index field 'Parent' (a nil value)?

Asked by 6 years ago
Edited 6 years ago

Error Picture - https://gyazo.com/1bc7f8c08f351d608e0738119d14a602 Game - https://www.roblox.com/games/1777375111/Testing Frame Setup - https://gyazo.com/c7671c5f2c2d48480ba365921e0f4c6d

script.Parent:WaitForChild("AlertSound"):Play()
wait(15)
script.Parent:WaitForChild("AlertSound"):Stop()
script.Parent:WaitForChild("AlertSound"):Destroy()
script.Parent.Parent.Parent:WaitForChild("CalloutGui"):Destroy()

It's in a script, it works for one of my friends. It doesn't come on my screen though. Any suggestions?

This is the only part that doesn't work. Everything else works perfectly.

0
It could possibly be that the object hasn't fully loaded yet, returning nil. Use :WaitForChild() or use wait() Rare_tendo 3000 — 6y
1
I used :WaitForChild() everywhere I could, that's the wrong script too. :p wait a second. killerbrenden 1537 — 6y
0
Shouldn’t you be using a localscript to do this? User#20279 0 — 6y
1
I tried it in a localscript and script. With the local script, it only showed on my screen, with a server script, it showed on other people's screen, killerbrenden 1537 — 6y

Answer this question