Hello. im trying to make a subtitle script but when it fades out the ui stroke comes back when it just faded out and i can’t see a solution so help is very appreciated.
function onClicked(onClicked)
local frame = script.Parent
local frameStroke = script.Parent.UIStroke
game.Workspace.House.LivingRoom:WaitForChild("TV remote"):FindFirstChild("ClickPart").Sound:Play()
for i = 1,40 do
frame.TextTransparency -= 0.1
frameStroke.Transparency -= 0.1
wait(0.01)
end
wait(3)
for i = 1,40 do
frame.TextTransparency += 0.1
frameStroke.Transparency += 0.1
wait(0.01)
end
end
game.Workspace.House.LivingRoom:WaitForChild("TV remote"):FindFirstChild("ClickPart").ClickDetector.MouseClick:Connect(onClicked)
Quick questions do you want it to “fade out” for every client or only one client who clicked?
If you want it for the client who clicked you’d have to parent the frame to PlayerGui instead.
SCREENGUIHERE.Parent = LocalPlayer:WaitForChild("PlayerGui") -- This has to be in a localscript inside the screengui so basically like local SCREENGUIHERE = script.Parent
GUIs in StarterGui are automatically parented to PlayerGui, your basically doing it twice if you execute that code. And your waiting for PlayerGui, which is basically already loaded in the first seconds of loading.