Script to print doesn't work

I’m making a script to print whats player write in textbox, but the script thinks the text its the player.

Local Script

-- I didn't write all the script, there is a MouseButton1Click function
local plr = game.Players.LocalPlayer
local text = script.Parent.Parent.TextBox
game.ReplicatedStorage.print:FireServer(text, plr)

Script - ServerScriptService

printEvent.OnServerEvent:Connect(function(text, plr)
    print(plr.Name .. "printed: " .. text.Text)
end)

If u know whats wrong here, please say.

2 Likes

When you send something from the server, the first argument is the player. So you don’t have to send the player to the server, because it’s already sent. So the first argument for OnServerEvent is actually the player, and the second argument is the Text.

All you need to do on the first line is to printEvent.OnServerEvent:Connect(function(Player,text) this should work.