ExaLua
(CoolBloxxer93)
July 30, 2021, 5:29pm
#1
Hello! I am trying to make it so that text from a textbox gets sent to the server.
The script is:
local TextString = tostring(script.Parent.Parent.TextBox.Text)
print(TextString)
game.ReplicatedStorage.TextFire:FireServer(TextString)
On the server side all it prints out is “Text” while on the client side it prints out what I typed.
Can you show the server script?
1 Like
ExaLua
(CoolBloxxer93)
July 30, 2021, 5:36pm
#3
game.ReplicatedStorage.TextFire.OnServerEvent:Connect(function(Text)
print(Text)
end)
I realized that text was in quotes so I fixed that but now it says my username instead.
iBuzzes
(Silly_Ryan)
July 30, 2021, 5:37pm
#4
The first parameter is the player who fired the remote event. So put the text in the second parameter.
1 Like
Change the function params to (player, Text)
RemoteEvent.OnServerEvent passes the player who fired it as the first parameter and any other parameters you fired after.
1 Like