#gui to server script

35 messages · Page 1 of 1 (latest)

tropic topaz
#

Like remote..?

potent verge
# tropic topaz Like remote..?

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

tropic topaz
#

When pressed, fire remote to server

potent verge
#

i dont know how events work

tropic topaz
#

Then from server fire all clients to spawn the part

potent verge
tropic topaz
#

So gonna be same script that fires to server

potent verge
#

but idk how

brave prairie
brave prairie
#

Local script -> re -> server -> spawn part on server

tropic topaz
potent verge
#

gui = local script

brave prairie
#

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)

potent verge
#

how does that work?

brave prairie
potent verge
#

okay

brave prairie
#

On the event spawn the part on client

potent verge
#

alr thanks

#

but it was an example, the thing i am try to do is way harder

keen robinBOT
#

studio** You are now Level 2! **studio

brave prairie
potent verge
#

a lobby system like doors but via gui

#

like how the mimic did it

#

or blair

brave prairie
potent verge
#

i mean if someone pressed "join lobby" or something, the other players see it too

brave prairie
#

Just send the visual change to the clients. Then make them all adjust the ui other than the guy who joined