OnClientEvent not returning arguments?

Hello. I am firing the client from my script using the following code:

game.ReplicatedStorage.Resp:FireClient(plr, "notints")
“noints” being a string I want to pass to the client.

In my LocalScript I have the following code:

resp.OnClientEvent:Connect(function (plr, resp)
print(resp)
end)

and “resp” is returning nil, not notints, why is this happening?

1 Like
resp.OnClientEvent:Connect(function(response)
	print(response)
end)

Use a different name for the RemoteEvent and the argument “resp”.

1 Like

I changed the argument to “resps” and it still doesnt work.

resp.OnClientEvent:Connect(function(resp)
     print(resp)
end)
2 Likes

You only have to send the player object, your string is under the name of plr on the client-side.

What @samtheblender said

1 Like

This is returning nil because you are aswell sending the player on the client side, you get the player automatically in an event on the server side, therefore when you pass a player through the client side to the server side the player will be nil, if you removed plr from plr, “notints” the above should work.