Hey, I’m trying to make a passenger information system. All dispatchers should have a GUI where they can change the status of each train. But the new status should also be visible to every other dispatcher. Now I’ve reached the point, how do I change the status for each GUI? I hope someone can help me?
do you have a specific team for the dispatchers? if so you can make a remote event and fire it from the server to their clients.
here’s an example on how to do it :
local Remote = game.ReplicatedStorage.RemoteEvent
for i,v in pairs(game.Players:GetPlayers()) do
if v.Team == game.Teams.YourTeam do
Remote:FireClient(v)
end
end
I’d suggest using a remote event and changing everybody’s UIs to display what you want using a server script
local Replicated = game:GetService("ReplicatedStorage")
local Players = game:GetService("Players")
local Teams = game:GetService("Teams")
local Remote = Replicated:FindFirstChild("Remote")
for _,Player in pairs(Players:GetPlayers()) do
if Player.Team == Teams["YourTeam"] then
-- do code
end
end
[Note that this for loop would run once here, so you’d need to act accordingly and put in within a loop or anything else you need].
I have already tried this myself with FireServer but I have the problem that I don’t know what should happen then, so I execute the command that all clients are fired but what happens then? How do I get strings to other clients with RemoteEvents?
The client will be
game.Players.LocalPlayer
--server
status.Changed:Connect(function()
remoteEvent:FireAllClients("trainName","status")
end)
--client
remoteEvent.OnClientEvent:Connect(function(player,trainName,status)
label.Text=status
end)
–serverScript
use “serverScript” (fireallclient with remoteEvent) from server to client
provide name of the train and status as parameters
–clientScript
compare and find the train that relates to this change using
(if condition and trainName)
change the status by setting the text=status
something like that…
It works thank you very much! You really helped me 
glad it worked, goodluck
character limit