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

How to make a text appear in Screen, later disappear?

Asked by 4 years ago
Edited 4 years ago
function effects()
    local l = Instance.new("TextLabel")
    l.Name = "msg1"
    l.Parent = game.Players.PlayerGui
    l.Position = UDim2.new(0.288834959, 0, 0.45161289, 0)
    l.Text = "Hello"
    l.TextColor3 = Color3.new(1, 0, 0)
    l.BackgroundTransparency = 1
    l.TextSize = 31
    wait(3)
    local at = l
    at:Destroy()
end
script.Parent.Touched:connect(effects)
0
Can you elaborate what you are trying to say? Vxpper 101 — 4y
0
If you want, a text is displayed on the screen, and then disappears. Opt_Blacky 1 — 4y
0
All Gui elements need to be in a ScreenGui if you want to display them on a player's screen. pidgey 548 — 4y

1 answer

Log in to vote
0
Answered by 4 years ago
Edited 4 years ago

You should put everything in ScreenGui, otherwise it will not appear on screen

function effects()
    local ScreenGui = Instance.new("ScreenGui", game.Players.PlayerGui)
    local l = Instance.new("TextLabel", ScreenGui)

    l.Name = "msg1"
    l.Position = UDim2.new(0.288834959, 0, 0.45161289, 0)

    l.Text = "Hello"
    l.TextColor3 = Color3.new(1, 0, 0)
    l.BackgroundTransparency = 1
    l.TextSize = 31

    wait(3)

    local at = l
    at:Destroy()
end
script.Parent.Touched:connect(effects)
Ad

Answer this question