im trying to make a dialog/text pop up once you press a part, i have a semi-working script for this but it’s a horrible script (i found it on a youtube video since i cant script by myself!) i need help with a script that makes it fade in, stays for a few seconds, then fades out. i also need this script to only happen once, once the part is pressed and only appear for the player that pressed it.
game.Workspace.Trigger.Touched:Connect(function(hit)
if hit and hit.Parent then
local debounce = true
script.Parent.Visible = true
script.Parent.TextTransparency = 1
wait(0.025)
script.Parent.TextTransparency = 0.9
wait(0.025)
script.Parent.TextTransparency = 0.8
wait(0.025)
script.Parent.TextTransparency = 0.7
wait(0.025)
script.Parent.TextTransparency = 0.6
wait(0.025)
script.Parent.TextTransparency = 0.5
wait(0.025)
script.Parent.TextTransparency = 0.4
wait(0.025)
script.Parent.TextTransparency = 0.3
wait(0.025)
script.Parent.TextTransparency = 0.2
wait(0.025)
script.Parent.TextTransparency = 0.1
wait(0.025)
script.Parent.TextTransparency = 0
wait(2)
script.Parent.TextTransparency = 0
wait(0.025)
script.Parent.TextTransparency = 0.1
wait(0.025)
script.Parent.TextTransparency = 0.2
wait(0.025)
script.Parent.TextTransparency = 0.3
wait(0.025)
script.Parent.TextTransparency = 0.4
wait(0.025)
script.Parent.TextTransparency = 0.5
wait(0.025)
script.Parent.TextTransparency = 0.6
wait(0.025)
script.Parent.TextTransparency = 0.7
wait(0.025)
script.Parent.TextTransparency = 0.8
wait(0.025)
script.Parent.TextTransparency = 0.9
wait(0.025)
script.Parent.TextTransparency = 1
wait(0.025)
script.Parent.Visible = false
local debounce = false
end
end)
this is the script i currently have (it's hideous, i know) but i can't make it only happen once

5 comments
where do i put this script? the frame / text or the trigger part? (sry im a noob lol)
this won't work. you'd need to do a different KIND of tween.
(he also meant TextTransparency, using just Transparency won't run)
oh ok
@omorizz the text