Trying to Send Data from Server to Single Client--What Am I Doing Wrong?

All I am trying to do is sent a single number from the server to a single client. This should be easy, but I keep getting a “nil” in the client script. What am I doing wrong? I am totally stumped.

Server script:

Remaining:FireClient(player, number)

The remote event is in ReplicatedStorage and is called “Remaining”. I checked and the value “number” is correct and player is identified. There doesn’t appear to be an error on this side.

Client Script:

local player = game.Players.LocalPlayer
local textbox = script.Parent
local Remaining = game.ReplicatedStorage.Remaining

Remaining.OnClientEvent:Connect(function(player, number)

print(number)

textbox.Text = number …" Left in Backpack"

textbox.Visible = true
wait(.5)
textbox.Visible = false

end)

All I get is the error message “attempting to concatenate nil with string.” The print (number) shows me that the client is getting “nil” for number.

Shouldn’t it be possible to pass data through remote events like this? What am I missing?

In the client, you don’t need the player argument.

Take out player and just have number

Thank you man! Took it out and now the script works.

1 Like

next time refer to the api pages, they give you info on what parameters are used in the examples