Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
1

bad argument #3 to 'Text' (string expected, got Object) ?

Asked by
ksony 54
5 years ago
Edited 5 years ago

bad argument #3 to 'Text' (string expected, got Object) ?

issue is in server script

Local Script :



local player = game.Players.LocalPlayer script.Parent.MouseButton1Click:Connect(function() game.ReplicatedStorage.msg:FireServer(script.Parent.Parent.TextBox.Text) end) script.Parent.Parent.TextBox.FocusLost:Connect(function(enterPressed) game.ReplicatedStorage.msg:FireServer(script.Parent.Parent.TextBox.Text) end)

Server Script :


wait(3) game.Lighting.Msg:Clone().Parent =script.Parent.Head function fs1(text) script.Parent.Head.Msg.Image.Texter.Text = text end game.ReplicatedStorage.msg.OnServerEvent:Connect(fs1)
0
You need to filter text created by a user before showing it to other players in the game!!! User#5423 17 — 5y

1 answer

Log in to vote
0
Answered by 5 years ago
Edited 5 years ago

The first parameter of OnServerEvent is always the player that fired the remote. Therefore, you just need to add it to your function's arguments.

wait(3)
game.Lighting.Msg:Clone().Parent =script.Parent.Head

function fs1(player, text)
    script.Parent.Head.Msg.Image.Texter.Text = text
end

game.ReplicatedStorage.msg.OnServerEvent:Connect(fs1)

0
Now show this issue : bad argument #3 to 'Text' (string expected, got Object) ksony 54 — 5y
Ad

Answer this question