I made a horror game and I want to add some text appear when you touch a block. Like you touch the block text fades in, wait 5 seconds then it fades out. I tryed this with step-by-step process but it won't work.
function onTouch()
game.StarterGui.ScreenGui.Frame.Visible = true
wait (0.5)
game.StarterGui.ScreenGui.Frame.TextLabel.Transparency = 0.9
wait (0.5)
game.StarterGui.ScreenGui.Frame.TextLabel.Transparency = 0.8
wait (0.5)
game.StarterGui.ScreenGui.Frame.TextLabel.Transparency = 0.7
wait (0.5)
game.StarterGui.ScreenGui.Frame.TextLabel.Transparency = 0.6
wait (0.5)
game.StarterGui.ScreenGui.Frame.TextLabel.Transparency = 0.5
wait (0.5)
game.StarterGui.ScreenGui.Frame.TextLabel.Transparency = 0.4
wait (0.5)
game.StarterGui.ScreenGui.Frame.TextLabel.Transparency = 0.3
wait (0.5)
game.StarterGui.ScreenGui.Frame.TextLabel.Transparency = 0.2
wait (0.5)
game.StarterGui.ScreenGui.Frame.TextLabel.Transparency = 0.1
wait (0.5)
game.StarterGui.ScreenGui.Frame.TextLabel.Transparency = 0
wait (5)
game.StarterGui.ScreenGui.Frame.TextLabel.Transparency = 0.1
wait (0.5)
game.StarterGui.ScreenGui.Frame.TextLabel.Transparency = 0.2
wait (0.5)
game.StarterGui.ScreenGui.Frame.TextLabel.Transparency = 0.3
wait (0.5)
game.StarterGui.ScreenGui.Frame.TextLabel.Transparency = 0.4
wait (0.5)
game.StarterGui.ScreenGui.Frame.TextLabel.Transparency = 0.5
wait (0.5)
game.StarterGui.ScreenGui.Frame.TextLabel.Transparency = 0.6
wait (0.5)
game.StarterGui.ScreenGui.Frame.TextLabel.Transparency = 0.7
wait (0.5)
game.StarterGui.ScreenGui.Frame.TextLabel.Transparency = 0.8
wait (0.5)
game.StarterGui.ScreenGui.Frame.TextLabel.Transparency = 0.9
wait (0.5)
game.StarterGui.ScreenGui.Frame.TextLabel.Transparency = 1
wait (0.5)
game.StarterGui.ScreenGui.Frame.Visible = false
end
script.Parent.Touched:connect (onTouch)
Thx for the help!

1 comment
StarterGui is simply where stuff is cloned from. It can't change very player's gui,