I have gui that clones yourself to playergui when player joining but when my character resetting gui dont appears
game.Players.PlayerAdded:Connect(function(Player) local GUI = game.ReplicatedStorage.Storage.AdminBar ---------- local Alex = Player.Name == "AIexR32" local Clemaek = Player.Name == "Clemaek" ---------- if Alex or Clemaek then Player:WaitForChild("PlayerGui") GUI:Clone().Parent = Player.PlayerGui end end)
i need check if character loaded in workspace then clone gui to playergui
I made an entire edit to the script. I noticed you were using usernames as authorization, using ID's are better. All explanation is in the script.
local ApprovedIDs = {} -- Your friends IDs game.Players.PlayerAdded:Connect(function(Player) repeat wait() until workspace:FindFirstChild(Player.Name) -- Waits until the character is in workapce for i,v in pairs(ApprovedIDs) do -- loops through table if Player.userId == v then -- if the id in the table matches the new player local GUI = game.ReplicatedStorage:WaitForChild("Storage").AdminBar:Clone() -- clones repeat wait() until Player:FindFirstChild("PlayerGui") -- waits for playergui GUI.Parent = Player.PlayerGui -- parents the clone end end end)
OR
local ApprovedIDs = {} -- Your friends IDs game.Players.PlayerAdded:Connect(function(Player) Player.CharacterAdded:Connect(function() for i,v in pairs(ApprovedIDs) do -- loops through table if Player.userId == v then -- if the id in the table matches the new player local GUI = game.ReplicatedStorage:WaitForChild("Storage").AdminBar:Clone() -- clones GUI.Parent = Player:WaitForChild("PlayerGui") -- parents the clone end end end) end)