#gui to server script
35 messages · Page 1 of 1 (latest)
idk, like for an example: if i make an ui button, when pressed a part gets inserted. the part is also visible on the server but not for the person that pressed the button with a local script.
if it is a local script, it isnt on the server
so i think it works with an event
Difficult ish but
When pressed, fire remote to server
i dont know how events work
Then from server fire all clients to spawn the part
ye smt like that
yes
And like make so it's not the presser
So gonna be same script that fires to server
Just spawn it on the server, then it will be visible on all clients
Not what he wants
Local script -> re -> server -> spawn part on server
but not for the person that pressed the button
gui = local script
Oh, then just loop through all the clients and skip the one that fired
RE.OnServerEvent:Connect(function(plr)
for _, p in game.Players:GetPlayers() do
if p == plr then continue end
RE:FireClient(p)
end
end)
how does that work?
Yes, on the client just fire the event and receive it
okay
On the event spawn the part on client
** You are now Level 2! **
Like change a ui or what?
Then just change the ui as you seem fit
i mean if someone pressed "join lobby" or something, the other players see it too
Just send the visual change to the clients. Then make them all adjust the ui other than the guy who joined