The title is self explanatory:
local k = script.Parent local s = script.Parent:FindFirstChild("Click") local hm = script.Parent:FindFirstChild("vhs thing") local other = script.Parent:FindFirstChild("Sound") hm:Play() wait(0.5) k.Text = "W" s:Play() wait(0.5) k.Text = "We" s:Play() wait(0.5) k.Text = "Wel" s:Play() wait(0.5) hm:Stop() k.Text = "Welc" s:Play() other:Play() wait(0.5) k.Text = "Welco" s:Play() wait(0.5) k.Text = "Welcom" s:Play() wait(0.5) k.Text = "Welcome" s:Play() wait(1) repeat wait(0.1) k.TextTransparency = k.TextTransparency + 0.1 until k.TextTransparency == 1 wait(3) repeat wait(0.1) other.Volume = other.Volume - 0.1 until other.Volume <= 0 script.Parent.Sound.Volume = 0 script.Parent:Destroy()
spawn
function, or just use a for
loop!. And you don't have to manually set the text each time, use string.sub
!local welcome = "Welcome" local k = script.Parent local s = script.Parent:FindFirstChild("Click") local hm = script.Parent:FindFirstChild("vhs thing") local other = script.Parent:FindFirstChild("Sound") hm:Play() wait(0.5) for i = 1, welcome:len() do wait(0.1) k.Text = welcome:sub(1, i) -- cool function that gives text typewriter effect end wait(1) for i = 0.1, 1, 0.1 do -- loop the transparency wait(0.1) k.TextTransparency = i end wait(3) for i = other.Volume, 0, -0.1 do -- loop at the volume to 0 wait(0.1) other.Volume = i if i <= 0 then -- if i is 0 destroy script.Parent script.Parent:Destroy() break end end
The second loop could be
while true do other.Volume = other.Volume - 0.1 wait(.1) if other.Volume == 0 then script.Parent:Destroy() end end)