Is it ok to use scripts in GUI?

They aren’t cloned locally, they are cloned and can be seen by the server, however, changes the client makes don’t replicate, the server actually clones them.

Edit: I think they used to be cloned locally, but now, they are cloned on the server, I really don’t see a point in doing that if it would lead to bad practices, as you should never access the PlayerGui on the server

No, it is not proper use. GUIs are client-side and should ONLY use a LocalScript. Just because you can do something, doesn’t mean you should. Using RemoteEvents is not hard, and it’s something every single developer needs to be able to do in order to do anything.

Ik how to use remote events, I was just asking, bec I didnt saw it earlier and my friend want to rate his new scripter.

Using a server script in GUIs is so far the worst idea ever because first of all, there will be lots of vulnerabilities, especially in games that saves. Some exploiters might take advantage of the server scripts from the interface and they might even steal the code as well, leading to even huge problems.
I’d suggest he should use local scripts instead for the interfaces and the server scripts for the main functionality of the game into safe places, such as ServerScriptService. If you want to commute between them, simply use RemoteEvent or RemoteFunction, which is actually not that difficult after you get used to it.
I hope you two will do a really great job.
Good luck and have a nice day.

1 Like

Just because the server script is in a place that is replicated to the client, it does not mean that the server script is sending it’s bytecode to the client nor is it accepting data from the client.

Decompiling a server script no matter where it is, is impossible.
But yes I do agree visuals should be handled on the client and the main functionality of the game on the server, also am I the only one that thinks putting a LocalScript in PlayerGui is a sin?

2 Likes

Exploiters can only steal client sided code.

3 Likes