FIreClient issues?

After the last few hours I’ve been getting really fed up with Studio,
I am trying to make a matchmaking system and everything works except from the last step, the last step is to Fire an event with data to both of the chosen players, however when I FireClient it only works for 1 player!

My script:

for i, v in pairs(game.Players:GetChildren()) do
      if v.UserId == userId then
             remotes.sendMatch:FireClient(v, {data})
       elseif v.UserId == randomMatch then
             remotes.sendMatch:FireClient(v, {data})
         end
     end
end

it should be just giving sending 2 events to 2 different players(also randomMatch is the just a UserId)

Where are userId and randomMatch assigned? Are you sure they’re not the same value?

You could simplify this by using :GetPlayerFromUserId() GetPlayerByUserId Api
if that dosen’t work, have you verified that RandonMatch is a userid, and that its a number and not a string?

I’ve verified random match is a userID but I’ll try your idea and see if it works

1 Like

Yep, am sure they’re not they same value, they are assigned above this line of code

Nvm, I was receiving the event in a Module script function but it worked when I received it in a LocalScript

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.