Event:FireClient() not working?

hey all. why doesn’t Event:FireClient() work from a server script? When ever i attempt this i get the same error; “[Argument 1 missing or nil]”

a solution would be much appreciated.

3 Likes

You have to put the Player you’re firing the information to as the first argument. Otherwise, it will not work.

18 Likes

Can you share your code?

Just the section that is trying to remote fire and maybe the client code. I’m currently working on this exact same thing and I think I have it fully nutted out. Spent ages researching it.

@DesiredFlamingFire has the right solution here, but I thought it worth mentioning that you can fire all clients with Event:FireAllClients()

ok so basically:
to fire at a single client then it would be:

event.FireClient(playertofireat, thingtosend)

or if you want to do all clients in game then you can do:

event.FireAllClients(thingtosend)

but with the script receiving the Fire doesn’t have a player argument

event.OnClientEvent:Connect(function(thingtosend)
   -stuff
end)
5 Likes

First argument of the FireClient method is missing. You need to specify what player you are firing the event for.

Event:FireClient(player);

You are missing the player argument. You need to put the player argument in the parenthesis like so Event:FireClient(PlayerInstance, SomeArgument).

Alternatively, you can use Event:FireAllClients(SomeArgument) which does not require a player argument, but will fire the remote event on all clients / players.

You don’t need SomeArgument but I put it there to show you that you can “Broadcast” multiple arguments to the player

Oh thanks. Didn’t realize that you had to chose a player to fire an event to a client

1 Like

Oh, Thanks! Never thought of that.

1 Like