I have a Gui in StarterGui (Parent Trees below.. triggerScript is a localScript). storeTrigger is a textButton that when the user clicks the button, it toggles visibility for the store Gui. The button and the rest of the store share the same storeStock Parent.
game.StarterGui.storeStock.storeBG.marketTitle
game.StarterGui.storeStock.storeTrigger.triggerScript
local btnToggle = game.StarterGui.storeStock.storeTrigger
local visibleState = false
function toggleGui(isVisible)
game.StarterGui.storeStock.storeBG.Visible = isVisible
if isVisible == true then
visibleState = false
else
visibleState = true
end
end
btnToggle.MouseButton1Down:connect(function()
toggleGui(visibleState)
end)
When I click on the button, nothing happens. No error messages in output or anything. Can anyone tell me what I'm doing wrong?

1 comment
You need to access the player's gui. Not the starter gui. The starter Gui contains all the gui elements that are given to the player when the join/respawn.