You don’t need to fire server with the player argument since function itself does that for you and also that sets 2nd parameter of the function connected to OnServerEvent to the player you sent as the first argument, not the text you passed as the 2nd argument.
So just change :FireServer(plr, script.Parent.Text) to :FireServer(script.Parent.Text).
Don’t fire the server with the client, only send what you wanna send. On the server event section just do: per,newName. It’ll automaticly send the player FIRST. So don’t send it yourself.
Yes, I understand that. But if you send the player in a remote event It breaks the script, you only want to send information. When you “capture” the remote event on the server side just put: plr before any information. It’ll automaticly send it and make it the first thing you can call.
The script isn’t broken. I am trying to everything I can to make it print the filtered text and not “Instance”. It still prints, therefore it isn’t working… just not printing as intended.
As has been said several times, your confusion seems to stem from misunderstanding how FireServer arguments are received. The client who fired the remote is automatically the first argument given to the server followed by whatever you define. Simply removing the player from your LocalScript will fix it.
On another note though: both the RemoteEvent and the script responsible for handling OnServerEvent should not be children of your TextBox. Canonically you should be putting your remotes in ReplicatedStorage and your scripts in ServerScriptService. Guis should only contain LocalScripts and ModuleScripts (the latter of which is intended to run in a client-side environment after being required by a LocalScript). Would advise rethinking your structure in addition to fixing the initial issue.
No. It doesn’t fix at all. To my knowledge it doesn’t matter if you have plr there. My other script will recognize it as plr. I don’t have to remove it.
Yes it does matter if you have the player there, because now you’re slotting those arguments further away. A RemoteEvent will always receive n+1 arguments. The server will always receive the firing client as the first and the other arguments are pushed down.
If you send the player and the text, your server will receive three arguments: the player twice and the message. You’re only accounting for two arguments, so your third one is dropped. Please read the documentation, it does fix it.