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

Startergui isn't working for me? it says it isnt a valid member of playergui

Asked by
6LB0 0
6 years ago
Edited 6 years ago

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

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

1 answer

Log in to vote
0
Answered by 6 years ago
Edited 6 years ago

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)
0
If the word, 'visible', isn't showing up, click 'view source'. Araknala 14 — 6y
Ad

Answer this question