You can write your topic however you want, but you need to answer these questions:
What do you want to achieve? Keep it simple and clear!
I want to make a normal script that changes a GUI. Ex: Makes a GUI visible
What is the issue? Include screenshots / videos if possible!
I can’t seem to find a good solid answer anywhere.
What solutions have you tried so far? Did you look for solutions on the Developer Hub?
I looked at a lot of places. I know it should be easy to find but most people are just saying like you should use a local script or whatever. I can’t find a good answer.
Fire a RemoteEvent that the client(s) are listening to, and then on the client, perform the action you want e.g.
-- server
local remote = --some remote
remote:FireClient(player) -- or remote:FireAllClients()
-- client
local remote = -- some remote
local guiobject = -- some gui obj
remote.OnClientEvent:connect(function ()
guiobject.Visible = true
end)
Late response? Maybe, but I have used this in a lot of old projects of mine like 3 years ago, works perfectly fine, u dont have to worry abt yielding and stuff
Changing UI from server is totally fine. I’ve been doing it for all my games since I originally posted this. No issues. Only thing is, if you make a ui element on a local script for example. the server won’t be aware of it and it will error. of if u make something invisible on a local script, the server will still think it’s visible
User interfaces (UI) is and always will be client-sided. The client renders it and interacts with it. The replication boundary will ultimately prevent you from being able to solely develop UI from the server, as more adverse consequences involve user input not replicating. The next major issue is latency. UI is the last thing the user should be experiencing latency in. and this is one part of why user experience (UX) is so closely associated with UI.
The most harmful ideology in software development is “if it works, it works”. It is a key path to inviting the consequences of Murphy’s laws
when I meant by ‘for me its working’, doesn’t mean i meant that i have been using it on buttons, for that i have a custom handler but i use it mainly for protection against skids / cheaters, stealing code and using it as obfuscated has been a common problem, for visuals its the best thing to use if u want your code protected, about latency, it may have a small delay but I really much doubt it’ll have a lot of impact, on <13 kids won’t care abt the small delay produced unless its 1+ second OR a noticeable delay
btw, I have never used serverside for UI creation or rendering, UNLESS its a engine which i have tried and completed a lot. I exprimated myself wrong when i said its totally fine to use it
Of course UI is made to be MOSTLY client based, but that DOESN’T MEAN it should all be. There are many times where it should be server based. for example a match countdown timer should be changed from server so it’s in sync with all players. Also buying items should be controlled on server. It’s too easy to exploit if not in many cases. If a player buys a item the server should take the money from the player and only then add it to their inventory to be able to be used
None of these examples requires you to operate UI from the server. UI should continue to be operated on the client, where RemoteFunctions and/or RemoteEvents are used to involve the server