This is the full script, what I'm trying to do is to make the GUI only appear only once which is when the player joins the game, it is working in Roblox Studio but not in actual Roblox Game.
function onPlayerEntered(newPlayer)
wait(.1)
local stats = Instance.new("IntValue")
stats.Name = "leaderstats"
local stats2 = Instance.new("IntValue")
stats2.Name = "Tycoon"
stats2.Parent = newPlayer
stats.Parent = newPlayer
wait(.1)
local clone=game.ReplicatedStorage:FindFirstChild("GUIs"):FindFirstChild("JoinGui")
local player = game.Players.LocalPlayer
clone.Parent = player.PlayerGui
end
game.Players.ChildAdded:connect(onPlayerEntered)

3 comments
Is this a Script or a LocalScript?
if it works in studio im guessing it's not a script..