I have these scripts that pass a players username from one client to the rest of the clients. when I try to pass an argument through a remote event, it doesn't work. Here are the scripts
-- script game.Workspace.Room1.OnServerEvent:Connect(function(player) game.StarterGui.Rooms.Frame.Room1.Owner.Value = player.Name game.StarterGui.Room1:FireAllClients(player) end)
. .
-- local script local function OnClick() script.Parent.TakenBy.Text = ("Taken by "..(game.Players.LocalPlayer.Name).."!") script.Parent.Owner.Value = game.Players.LocalPlayer.Name game.Workspace.Room1:FireServer() end script.Parent.MouseButton1Click:Connect(OnClick) game.StarterGui.Room1.OnClientEvent:Connect(function(plr) -- below is the line the output error is talking about script.Parent.TakenBy.Text = ("Taken by "..(plr).."!") end)
the localscript is in startergui. When the remote event is fired, the output says LocalScript:11: attempt to concatenate local 'plr' (a userdata value)
. what does that mean? Btw I am a noob at scripting and I don't really understand arguments and parameters. I barely even know what im doing. If you need more information ask me.
You are passing the player, not the player's name.
game.StarterGui.Room1:FireAllClients(player.Name)