The error in the output makes absolutely no sense to me. Does anyone mind explaining what's going wrong? Error + Explorer
COMMUNITY QUESTION
How does this error even make sense?
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.

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