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

How do I make a Gui go into all of the Players PlayerGui?

Asked by 10 years ago

Well I've got this whole Gui script made out and it works just fine when I hit the Run Button, but when I press the Play Solo button the Gui does not appear at all.

here's a string of code where I think the problem is.

a = Instance.new("ScreenGui", game.StarterGui)

I want it to go to the PlayerGui instead of the StarterGui, but I'm just not sure how you would do that.

Thanks, BB1

1 answer

Log in to vote
1
Answered by
BlackJPI 2658 Snack Break Moderation Voter Community Moderator
10 years ago

By using the PlayerAdded function, you can tell when a player first joins the game. But if you want to give it to every character that spawns, you can use the CharacterAdded after PlayerAdded was already called. Your script should look something like this when completed:

game.Players.PlayerAdded:connect(function(player)
    player.CharacterAdded:connect(function(character)
        a = Instance.new("ScreenGui", player.PlayerGui)
        -- Rest of Gui stuff here
    end)
end)
0
Thanks for the help! I'm going to get right on it. bestbudd1 45 — 10y
Ad

Answer this question