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

Why is this giving me an error?

Asked by
DevingDev 346 Moderation Voter
7 years ago
Edited 7 years ago

I am making a player choose map gui and it just gives me an error on this script why?

while true do
    wait(0.2)
if script.Parent.Parent.Name == "PlayerGUI" then
    wait(5)
    script.Parent:Destroy()
    end
end

ERROR: choosemap=1 Players.Player1.PlayerGui.MapGUI.Script:3: attempt to index field 'Parent' (a nil value) Stack Begin Script 'Players.Player1.PlayerGui.MapGUI.Script', Line 3 Stack End

0
probably it did it once, then when he wants to do it again(since that's the loops job), he can't find it. add a "break" between line 5 and 6, then try it. 1N0body 206 — 7y
0
Thakns it's working know DevingDev 346 — 7y

Answer this question