Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How to clone a GUI to a player when they first enter?

Asked by 6 years ago

I've created a intro for a game but I only want it to show when the player first enters. For some reason my script isn't working. Maybe, it's because the game is FE? Can someone please help me out? (The script is located in ServerScriptService)

Code:

local Intro = script.AssetLoader:Clone()
game.Players.PlayerAdded:connect(function(player)
    player.CharacterAdded:wait()
    Intro:Clone().Parent = player.PlayerGui
end)

1 answer

Log in to vote
0
Answered by
thesit123 509 Moderation Voter
6 years ago

Michael, you made a little mistake, but it is okay. I happened to make those mistakes too.

So on line 1, you clone Intro. Then on line 4, you clone the cloned Intro. Which means you are cloning the clone. what? I know..

I fixed it for you below:

local Intro = script.AssetLoader
game.Players.PlayerAdded:connect(function(player)
    player.CharacterAdded:wait()
    Intro:Clone().Parent = player.PlayerGui
end)

Ad

Answer this question