Remote Client Data Issues

Hey Community,

Let me go into more detail, I am sending information from server to client in a remote event but I am getting nil as a response.

Server:

function checkKilled(plr, hit)
        --random stuff
		numofKillsEvent:FireClient(plr, 1) --the "1" is not getting through
end

Client:

numofKillsEvent.OnClientEvent:Connect(function(plr, data)
	print(data) --outputting nil
end)

Ask me if you need more information.
Thanks for the Help!

1 Like

Remove the “plr” argument on the OnClientEvent and only keep “data”, like this:

numofKillsEvent.OnClientEvent:Connect(function(data)
print(data)
end)
1 Like

but, will it go to the right player?

yea

When you use FireClient, the 1st argument is the player that the event will be fired to, everything else are the arguments that are passed to the player (this means the “plr” argument isn’t passed)

(i’m not the best at explaining so sorry if it sounds weird)

After editing it, it is saying unable to cast value into an object, I am confused on what this means.

Did you remove the “plr” argument from the server-side or the client-side?

Only remove the “plr” in the client-side. Keep it at the server-side so the server knows who to fire the event at

1 Like

oh…i see, that makes sense…that works, thanks a lot