ServerScript working in Client?

I tried something, inserted a Script as a Child under TextButton. If its clicked its printing 1. I set the Scripts Runcontext to Server, i clicked the Button and in the Output stands:
10:16:33.748 1 - Server - Script:2
There stands “Server”
So did this print to every Player in the Game? Why is a Server Script working in StarterGui?


Server Scripts works in the StarterGUI as script runs everywhere in the Explorer and because the Player’s GUI exist in Server Side. A Server Script doesn’t neccesarily need to be in ServerScriptService to run. :slight_smile:

1 Like

But if the player gui is within the local side, then how script detects the click if basically startergui was cloned by client side??? I’m so much confused right now

The player’s GUI isn’t only on the local side. It’s on the server as well.

2 Likes

OH, I just realised i missed one line in your sentence lol. Thanks btw

1 Like