Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

My arguments never work in remote events?

Whenever I need to send something to the server via remote event is keeps saying blah blah blah is not a valid member of player. So let's say I had these arguments in order in the remote event sent to the server: (player, TextBox) and if the variable player was referenced as a player and the TextBox was a TextBox. If in the receiving script I say for example: TextBox.Text = "Test." it would print this error:

Text is not a valid member of player.

Am I doing something wrong or can the only argument be a player? Sorry if this question is hard to read; I am writing this on mobile right now.

2 comments

0

Can you send the actual script os we know if you are doing something wrong?

0

There is no actual script. This always happens. It always sends the player instance but never the other args.

1 answer

✓ Accepted answer

That's because the first argument received by the server is always the player, and only then your arguments arrive.

For example if you do remote:FireServer(workspace, "hello"), the server would see it as (player, workspace, "hello")

So just stop sending the player as one of the arguments, and shift your argument numbers by 1 on the server.

4 comments

0

So should I always do (player, randomValue, otherArgs) ?

0

Or what?

0

I tried (player,"RandomValue",msg) and when I tried to print the message's text, it printed "nil",

0

Oh I get what you mean now! Thanks! It works fine now.

This discussion is preserved as it was. New answers, comments, and votes are closed.