So I have an effect when the player kills an enemy that makes some particles and sound effects
I’d like these to be synced to the animation so I made them play on the client since If i fired a remote event it’d have some delay
Of course, the problem is, doing this on the client doesn’t let the other players see it
SO I THOUGHT: After doing it on the client I'll fire an event to replicate it on the server
THE ISSUE:
If i use FireAllClients() it will also re-replicate on the player who fired the event first, so the player will see it happen twice
help please
Katrist
(Katrist)
December 26, 2023, 7:50pm
2
Fire it to every player except for the one who you already did the effect for.
How? does FireAllClients
have a parameter for that?
Katrist
(Katrist)
December 26, 2023, 7:53pm
4
Use a loop.
Code:
local Players = game:GetService("Players")
local RemoteEvent = whatever
for i, player in Players:GetPlayers() do
if player ~= alreadyFiredPlayer then
RemoteEvent:FireClient(player)
end
end
Oh… why didn’t I think of that?
Also Is it not necessary to use pairs() in a for loop?
1 Like
Katrist
(Katrist)
December 26, 2023, 7:54pm
6
Yeah, I’m using generalized iteration. It’s not necessary to use pairs
or ipairs
.
1 Like
system
(system)
Closed
January 9, 2024, 7:55pm
7
This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.