So I was programming a shop GUI when I got this error. ToolShop is not a valid member of PlayerGui “Players.steveisoff.PlayerGui”
It says there is an error on line 4 but I do not see one
local player = game.Players.LocalPlayer
script.Parent.MouseButton1Click:Connect(function()
player.PlayerGui.ToolShop.Frame.Visible = false
end)
Any help is appreciated.
Can you show us the set up in the explorer? The error means what your trying to reference doesn’t exist so it’s most likely just not pointing to the right instance.
(Sorry if the screenshot quality is not good)
Pure_Bacn
(Pure_Bacn)
July 16, 2021, 3:19am
#4
If your script loads before the item, it is nil when the script starts, so just use :WaitForChild() to fix that
How can I tell if the script is loads before the item?
It’s hard to tell but it looks like the screen ui is named “ShopUI” and not “ToolShop” though I could be wrong, I can’t really determine what it says.
1 Like
Yeah, it’s called ShopGUI. Changing the names should work.
I cant see the “toolbox” child in the explorer frame(cant see much of anything though). Maybe that’s a problem?
Pure_Bacn
(Pure_Bacn)
July 16, 2021, 3:22am
#9
Where is your script located? (charsssss)
Edit: nvm