Selecting GUI from StarterGui in server script

Hi guys, I’m trying to make it so that when a player is touching ‘part1’ and a player is touching ‘part2’ then a ‘PlayButton’ GUI becomes visible, I am doing this in a server script and at the moment its not working at all, I set the value ‘visible’ to false as you can see at the beginning of the script, yet it still shows up when I go into the game… any ideas what I’m


doing wrong? Thanks

You’re running into the same issue as a recent post I solved. You’re trying to change the GUI through the StarterGui which won’t work because it’s only replicated to the client when they join the game.

Refer to this link:

1 Like

Instead of accessing through StarterGui, try to access through either the PlayerGui of the LocalPlayer or just just how many .Parent's that are required to reach that gui.

1 Like

Thanks for the response,


I just did this and still not working… not sure what I’m doing wrong

Because you are running that script on the server and not the client. You can’t access the Local Player on the server. It’s messy the way you are doing it right now because you are having each client send the server an update to let them know if they are standing on a part or not.

You’ll have to send back an update to the client to change their GUI anyway, using a RemoteEvent. I would just handle the checks for players standing on the parts on the server using the BasePart.Touched event. Then if both parts are being touched send an event to those two players.

1 Like