how to pass data from server to client through remote events?
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
2 | game.Workspace.Room 1. OnServerEvent:Connect( function (player) |
3 | game.StarterGui.Rooms.Frame.Room 1. Owner.Value = player.Name |
4 | game.StarterGui.Room 1 :FireAllClients(player) |
.
.
02 | local function OnClick() |
03 | script.Parent.TakenBy.Text = ( "Taken by " ..(game.Players.LocalPlayer.Name).. "!" ) |
04 | script.Parent.Owner.Value = game.Players.LocalPlayer.Name |
05 | game.Workspace.Room 1 :FireServer() |
08 | script.Parent.MouseButton 1 Click:Connect(OnClick) |
11 | game.StarterGui.Room 1. OnClientEvent:Connect( function (plr) |
13 | script.Parent.TakenBy.Text = ( "Taken by " ..(plr).. "!" ) |
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.