Not sure why this script isn't working. Can I not use player in a remote event? I would also like to ask how would I make this show on everybody's gui?
local remote = game.ReplicatedStorage.JoinEvent
remote.OnServerEvent:Connect(function(player)
local frame = player.PlayerGui.LobbyGui.Frame
if frame.Players.Script.Players.Value < frame.Players.Script.MaxPlayers.Value then
if frame.Player2.Text == "" then
frame.Player2.Text = player.Name
frame.Player2.Player2.Value = player.Name
elseif frame.Player3.Text == "" then
frame.Player3.Text = player.Name
frame.Player3.Player3.Value = player.Name
else
frame.Player4.Text = player.Name
frame.Player4.Player4.Value = player.Name
end
end
end)
