Remote event refusing to fire, "Argument 1 missing or nil."

I have a remote event inside replicated storage. Both the local and server scripts reference it properly. I’m making something like an arena queue system, where, after there are two players willing to fight, it will do a bunch of code to teleport them to the arena, give them weapons, etc. Since I want their match wins displayed on a screenGui, I need to communicate with a local script. When the second player joins the queue, the code seems to get stuck at the line where the event is fired, saying:
“Argument 1 missing or nil.”
No real explanation, as this error message is super vague and also can have many reasons. Here’s sort of what my code is like:

SERVER SCRIPT (from where the error is occuring):

local event = game.ReplicatedStorage.Event
--code goes here, eventually we come upon an:
if #players == 2 then
event:FireClient()
--code 
end

LOCAL SCRIPT (may also be the culprit):

local event = game.ReplicatedStorage.Event

event.OnClientEvent:Connect(function()
--code
end)

Yes, the if statement is inside a function, and no, it’s not after any infinitely repeating loops. Thank you for reading, please help.

2 Likes

fire client including player as argument

4 Likes

Your reply made me realize that I using FireAllClients() was more suited to my code, but with the information you were given, yours is the right answer.

2 Likes

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