Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

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

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)

3 comments

0

Can you elaborate what you are trying to say?

0

If you want, a text is displayed on the screen, and then disappears.

0

All Gui elements need to be in a ScreenGui if you want to display them on a player's screen.

1 answer

✓ Accepted answer

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)

This discussion is preserved as it was. New answers, comments, and votes are closed.