Hello all.
I am trying to use Events
to send information, in this case being what a player enters into a TextBox
.
For some reason, both of the instances I refer to when I call the event, both come out as the player's username when only one of them should.
Here's the script that triggers the event:
script.Parent.MouseButton1Click:Connect(function() workspace.PrintThingy.RemoteEvent:FireServer(player.Name, tostring(script.Parent.Parent.Username_2.Text)) end)
Here's the script that receives the information:
local function typed(username, text) print(tostring(username)..' has typed into the TextBox: '..text) end script.RemoteEvent.OnServerEvent:Connect(typed)
I am not seeing the issue here.
Your issue is that remote events send the first parameter as player, so it would be
(player,username,text)
Which means you dont have to send the username, it sends it regardless, you can do player.Name on the server to get the username.