Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

How does this error even make sense?

The error in the output makes absolutely no sense to me. Does anyone mind explaining what's going wrong? Error + Explorer

1 comment

0

Dunno. Maybe screem is not fully loaded when the script runs? You could try WaitForChild().

1 answer

Error for those who didn't click the link: screem is not a valid member of PlayerGui

Most likely, your LocalScript is running before all of the PlayerGui has loaded. This means that your code will attempt to access screem before it exists, leading to that error. An awesome fix for this is the Instance:WaitForChild(string name) method.

For example, I will fix one of your lines:

from

previousbutton2 = script.Parent.Parent.screem.ImageButton2

to

previousbutton2 = script.Parent.Parent:WaitForChild("screem"):WaitForChild("ImageButton2")

1 comment

0

Thanks. I never knew that WaitForChild could be chained like that.

This discussion is preserved as it was. New answers, comments, and votes are closed.