So what I am trying to do is, if a admin speaks and says ":givescoreboard (name)" then it would see if that name is valid. But for some reason it does not clone the GUI to the person. Why is that?
local admins = {"dogovpain","RandamuHaise","Player1","6trxshankles9","RoberttOriginal"} local scoreboardValues = game.Workspace.ScoreboardValues game.Players.PlayerAdded:Connect(function(plr) plr.Chatted:Connect(function(msg) if msg:sub(1, 16) == ":givescoreboard " then for i = 1,#admins do if plr.Name == admins[i] then local addPlayer = msg:sub(17, msg:len()) print(addPlayer) if game.Players:FindFirstChild(addPlayer) then print("Player has been found") table.insert(admins, addPlayer) for i,v in pairs(game.Players:GetPlayers()) do if v.Name == admins[i] then if v.PlayerGui:FindFirstChild("ManualGui") then v.PlayerGui:FindFirstChild("ManualGUI"):Destroy() wait() local manual = script.ManualGUI:Clone() manual.Parent = v.PlayerGui end end end else print("Player has not been found") end end end end end) end) game.Players.PlayerAdded:Connect(function(player) local playerGui = player.PlayerGui for i = 1,#admins do if player.Name == admins[i] then local manualGui = script:WaitForChild("ManualGUI") local cloneGuiToPlayer = manualGui:Clone() cloneGuiToPlayer.Parent = playerGui if playerGui:FindFirstChild("ManualGUI") then return end end end end)
server
event:FireClient(player)
client
event.OnClientEvent:Connect(function() frame.Visible = true end)