Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

FireAllClient Firing at the exact same time?

I am trying to make something that changes the text of a label for all players at the same time and I am using FireAllClients and I have 2 of them but they run at the exact same time and it just shows the second text and not the first.

Script 1

script.Parent.Event:Connect(function(plr)
    changeNotifier:FireAllClients("Selecting Map...",3)
    local map = pickMap()
    changeNotifier:FireAllClients("Map Selected: "..map,3)
end)

Script 2

changeNotifier.OnClientEvent:Connect(function(text,dur)
    n.Text = text
    wait(dur)
    n.Text = ""
end)

3 comments

0

wait()

0

I did that and it did not show the second text

0

then you did it wrong.

1 answer

✓ Accepted answer

You shouldn't make the clients wait, that stops the second event from coming because they were busy waiting. Instead, make the server wait in between sending events. Like this:

script.Parent.Event:Connect(function(plr)
	changeNotifier:FireAllClients("Selecting Map...")
	local map = pickMap()
	wait(3)
	changeNotifier:FireAllClients("Map Selected: "..map)
end)

1 comment

0

This answer is good, but doesn't explain correctly what is wrong. The issue is that you are immediately firing again to say what the map is right when the "Loading map..." was posted before. You need to wait the duration that you are sending before sending again, or else the first one will never seem like it happened because they both fire at the exact same time,  causing the second one's text to

This discussion is preserved as it was. New answers, comments, and votes are closed.