Argument 1 Missing or Nil

Hello, today while fixing some bugs in my scripts: I’ve encountered an error, no matter how much I search about it I didn’t find the answer.
Argument 1 missing or Nil
Here is the code:

	for i,v in ipairs(game.Teams:GetChildren()) do
		if v.TeamColor == gang.TeamColor then
		game.ReplicatedStorage.GangSystem.ClientFire:FireClient() -- Error here
		else
		plr.Team = game.Teams:WaitForChild(gang.Name) -- gang is a team created by a script
		end	
	end		

(I also searched dev forum posts but still can’t understand my problem)
Thank you for your time :smiley:

2 Likes

FireClient takes a player as the first argument, but you didn’t give it anything. Instead do FireClient(plr).

2 Likes

Your not firing it to a specific player, if you want to fire it to every player, do

game.ReplicatedStorage.GangSystem.ClientFire:FireAllClients()

If you would like to fire it so a specific player, do this

game.ReplicatedStorage.GangSystem.ClientFire:FireClient() -- The client here.
5 Likes

Can’t I fire a client without anything else?

2 Likes

You can use FireAllClients() if you want to fire all clients. But otherwise there is no way for the system to know which client you mean.

You have to tell it what client to fire it to.

No you cannot, you must specific a player.

Oh, I see, alright, thank you.