Local script
local repStorage = game:GetService("ReplicatedStorage")
local remote = repStorage:WaitForChild("Remote")
local remote2 = repStorage:WaitForChild("Remote2")
local player = game.Players.LocalPlayer
script.Parent.MouseButton1Down:connect(function()
script.Parent.Parent.Parent.Joined.Visible = true
script.Parent.Parent.Parent.ServerList.Visible = false
if game.StarterGui.Menu.Joined.Name1.Text == "" then
remote:FireServer()
else
if game.StarterGui.Menu.Joined.Name2.Text == "" then
remote2:FireServer()
else
game.StarterGui.Menu.ServerList.Full.Visible = true
wait(2)
game.StarterGui.Menu.ServerList.Full.Visible = false
end
end
end)
Server script (Workspace)
local repStorage = game:GetService("ReplicatedStorage")
local remote = repStorage:WaitForChild("Remote")
local remote2 = repStorage:WaitForChild("Remote2")
remote.OnServerEvent:connect(function()
game.StarterGui.Menu.Joined.Name1.Text = game.Players.LocalPlayer.Name -- I don't know how to get the players name who clicked the Textbutton?
game.StarterGui.Menu.ServerList.Name1.Text = game.Players.LocalPlayer.Name
end)
remote2.OnServerEvent:connect(function()
game.StarterGui.Menu.Joined.Name2.Text = game.Players.LocalPlayer.Name
game.StarterGui.Menu.ServerList.Name2.Text = game.Players.LocalPlayer.Name
end)
