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)
✓ ANSWER ACCEPTED
How to make a text appear in Screen, later disappear?
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.

3 comments
Can you elaborate what you are trying to say?
If you want, a text is displayed on the screen, and then disappears.
All Gui elements need to be in a ScreenGui if you want to display them on a player's screen.