Here is the code:
local gui = script.ScreenGui
game:GetService("Players").PlayerAdded:Connect(function(player) if player == "SwordChin" then for i,v in pairs(game.Players:GetChildren()) do gui:Clone().Parent = v.PlayerGui end end end)
Try something like this:
local gui = script.ScreenGui local players = game.Players local function onPlayerAdded(player) --Separate functions for clarity if player.UserId == 640603301 then --Use the UserId instead of names, as that can never be changed local playerList = players:GetChildren() for count,player in ipairs(playerList) do --Use ipairs(). Also, properly naming variables is important gui:Clone().Parent = player.PlayerGui end end end players.PlayerAdded:Connect(onPlayerAdded)
This should work. Hope I helped :D