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

How do you make a Gui that appears whenever someone joins the game?

Asked by 9 years ago

Hey, guys! I was trying to make a player entered Gui that appears and slides down the screen whenever someone joins the game. This is what I tried:

game.Players.PlayerAdded:connect(function(player)
    local msg = Instance.new('ScreenGui', game.StarterGui)
    local frame = Instance.new('TextLabel', msg)
    frame.BorderSizePixel = 2
    frame.BoderColor3 = Color3.new(0,0,0)
    frame.Position = UDim2.new(0,560,0,-30)
    frame.Size = UDim2.new(0,200,0,30)
    frame.Text = player.Name .. " has joined the game."
    for i = 1,50 do
        frame.Position = frame.Position + UDim2.new(0,0,0,1)
        wait(0.01)
    end
    wait(3)
    for i = 1,50 do
        frame.Position = frame.Position - UDim2.new(0,0,0,1)
        wait(0.01)
    end
    msg:Destroy()
end)

This is inside a regular script, inside the Workspace. If anyone can help me and explain what I did wrong, I would gladly appreciate it!

1 answer

Log in to vote
1
Answered by
RedCombee 585 Moderation Voter
9 years ago

You are really close. You just need to put the message in the PlayerGui of the Player, not the StarterGui.

  local msg = Instance.new('ScreenGui', player.PlayerGui) -- This is to replace line 2
0
It works... Yet there's another problem... You only see the Gui for yourself. The Gui doesn't pop up when ANOTHER person enters, just when YOU enter... dpark19285 375 — 9y
Ad

Answer this question