so I made this door script that plays a sound when its moving and when its closed
I want to make it so when the door closes it makes a "Thud" sound, but I need to delay the thud sound by 1 second because it plays too early
function open() local finish = script.Parent.PrimaryPart.CFrame*CFrame.Angles(0,math.rad(90),0) sound:Play() click:Destroy() thud:Play() -- how to make this play 1 second later? for i = 0,1,.01 do local cfm = script.Parent.PrimaryPart.CFrame:lerp(finish,i) script.Parent:SetPrimaryPartCFrame(cfm) wait() end wait(1) script:Destroy() end
Make the thud sound play 1 second later without stopping the script. That is without adding a "Wait()" function.
Nevermind found the answer myself
delay(.8,function() thud:Play() end)