Server script not running in gui

I have a Screengui which holds a local script and a server script, however, when in a game the server script never runs. I tried putting a print at the start of the script to see it will even print that out, but it doesn’t.

Is there something preventing the script to run? What can I do to fix this issue?

1 Like

Server scripts don’t run in GUIs. They’re on the server after all. Use a LocalScript, scripts that run on the client.

4 Likes

Is this a change due to the switch over to filtering enabled?

Yes but it was never something you should have been doing in the first place.

2 Likes

This isn’t specifically the case.
It’s caused by FE, but server Scripts do run in PlayerGui and its decendants. What’s happening here is probably the fact that in FE the StarterGui only places the guis locally. Anything in StarterGui will go into the PlayerGui locally but will not replicate back to the server, and in this case, the Script is never ran by the server because the server is never aware it exists.

Possible ways to circumvent this are manually cloning the guis into PlayerGui from the server, and as such the code would/should run both LocalScript and Script. Whether it’s good practice or not I’m not one to tell.

8 Likes