Owner = "mustardfoot" local Players = game:GetService("Players") function onPlayerAdded(player) if player.Name == Owner then do game.ServerStorage.OwnerGui:Clone().Parent = game.StarterGui wait(4) game.StarterGui.OwnerGui:Destroy() end end end
I see no problem in output, but no matter what I do the gui won't show.
A problem I see a lot of people first starting out programming on Roblox have is understanding what exactly the services that Roblox gives you actually do, StarterGui being one of these services.
StarterGui is a Class that the Roblox team created so that you could very easily make every player that joins the game start with the tool in their backpack. However, developers often want to control when the player can obtain and use these tools.
Some developers get caught up in the StarterGui Class trying to use it like how you used it in your script, but the problem is it's just wrong. What if a user joins while the GUI is still in the StarterGui? Then he could get the GUI that he isn't suppose to have!
Using the PlayerAdded event like you did in your script, we can directly place the GUI we want the player to receive into their PlayerGui:
local Owner = "mustardfoot" local GUI = game.ServerStorage.OwnerGui game.Players.PlayerAdded:connect(function(player) player.CharacterAdded:connect(function(character) if player.Name == Owner then GUI:Clone().Parent = player.PlayerGui end end) end)
I also added in the CharacterAdded event so that the player gets the GUI again if they die, however there are other ways to get around this problem.