Hello, i have a script where there is a player list and it only shows players in the game other than u, there is a invite button next to there name, can anyone help me make a GUI clone onto their screen when invited?
local CloneToScreen = script.Parent.Parent.Invited:Clone()
local function AddPlayerList(plr)
local List = script.Parent.Player:Clone()
List.Visible = true
List.Parent = script.Parent.ScrollingFrame
List.PlayerName.Text = plr.Name
end
for i,v in pairs(game.Players:GetChildren()) do
if v ~= game.Players.LocalPlayer then
AddPlayerList(v)
end
end
game.Players.PlayerAdded:Connect(function(plr)
AddPlayerList(plr)
end)
game.Players.PlayerRemoving:Connect(function(plr)
for i,v in pairs(script.Parent.ScrollingFrame:GetChildren()) do
if v and v.Name == plr.Name then
v:Remove()
break
end
end
end)