Here is what I have so far, I want the sound to play then the door to open with at least 2 seconds wait! Here is what I have so far. It wont work! D: Also the sound is the same ID as it is in the script (Content Provider bit) The sound is in the script.
Speed = 0.1 -- Speed at which the door rises. Higher = faster. Time = 5 -- Time between the door totally open and starting to close. Running = false for x,z in pairs(script.Parent.Parent:getChildren()) do if z.Name == "Button" then z.CD.MouseClick:connect(function () if Running == true then return end Running = true Game:GetService("ContentProvider"):Preload("http://www.roblox.com/asset/?id=134966578") script.Sound:Play() wait (2) for i=1,script.Parent.Size.y/Speed*10+1 do script.Parent.CFrame = script.Parent.CFrame*CFrame.new(0,0.1*Speed,0) wait() script.Sound:Stop() end wait(Time) for i=1,script.Parent.Size.y/Speed*10+1 do script.Parent.CFrame = script.Parent.CFrame*CFrame.new(0,-0.1*Speed,0) wait() end Running = false end) end end
Place the sound in the door part, not the script.
When a sound runs in a LocalScript object, it plays for the LocalPlayer, disregarding the distance from the part that the script may be in. If it runs in a server script object, it will not play. Putting the sound in the door part and having it play that there will likely fix your problem.