I'm having a lot of trouble trying to get a character select screen to pop up. What lines of code can make it appear when a player clicks a button? This is what i have right now, any particular reason this code doesn't work?
local gui = game.StarterGui.CharSelect.CharSBox1
function onClicked(playerWhoClicked)
gui.Visible = true
end
script.Parent.ClickDetector.MouseClick:connect(onClicked)
sorry if it looks really simple, i just started scripting not so long ago Any help appreciated :)

2 comments
https://scriptinghelpers.org/questions/27842/startergui-is-not-a-valid-member-of-player
https://scriptinghelpers.org/blog/common-mistakes#PlayerGui