So I have a Button that when you click it I want it to change the players Gui from Unemployed to Cashier. It is not working and I can't figure out why. Any help? Here is what I got:
function onClicked(player)
game.player.PlayerGui.Job.Jobname.Text = "Cashier"
end
script.Parent.ClickDetector.mouseClick:connect(OnClicked)
P.S It is not in a local script, just an ordinary one. And this script is inside the Brick that you click.

1 comment
It is not recommended to modify client-sided things from the server. PlayerGui objects are considered client-sided things. If you use RemoteEvents and RemoteFunctions to communicate between the client and server, your games will be much more secure.