im trying to make a gui apear upon a button click but it is not working here is the script
script.Parent.ClickDetector.MouseClick:Connect(function(Clicked)
game:WaitForChild("Players"):GetPlayerFromCharacter(Clicked)
.PlayerGui.ScreenGui.Frame.Visible = true
end)
idk whats wrong with it but it is not working
edit: i think i should add more i am trying to make a click detector do this and the script is in the part with the click detector

1 comment
Reference the PlayerGUI, not the Starter.