when I touch the part it says shop isn't a valid member of playergui
script.Parent.Touch.Touched:connect(function(hit) if game.Players:GetPlayerFromCharacter(hit.Parent) ~= nil then game.Players:GetPlayerFromCharacter(hit.Parent).PlayerGui.Shop.Shop.Visible = true end end)
and when i try this it only comes up with FreeCamera
for i,v in pairs(game.Players.6LB0.PlayerGui:GetChildren()) do print(v.Name) end
COMMUNITY QUESTION
Startergui isn't working for me? it says it isnt a valid member of playergui
1 answer
The script should work, unless the hierarchy is wrong. So reply back with a picture of all the items in the 'Explorer' tab.
script.Parent.Touch.Touched:connect(function(hit)
if game.Players:GetPlayerFromCharacter(hit.Parent) ~= nil then
game.Players:GetPlayerFromCharacter(hit.Parent).PlayerGui.Shop.Shop.Visible = true
end
end)
1 comment
0
If the word, 'visible', isn't showing up, click 'view source'.
This discussion is preserved as it was. New answers, comments, and votes are closed.

3 comments
You need to define the shop as an instance with a parent set as player gui
I suggest you to access the player gui from a local script
your username is screwing up the second script because it starts with a number, consider using "game.Players["6LB0"].PlayerGui" instead