Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

script wont destroy sound at night time?

Asked by
soutpansa 120
5 years ago

When it's night, this script is supposed to destroy this sound that is playing in the workspace, but it doesnt. It places the sound in just fine, but wont destroy it. This is really annoying me. Any help?

while true do
    wait()
    if game.Lighting.ClockTime >= 7 and game.Lighting.ClockTime <= 17 then
        if workspace:FindFirstChild("Seagull") == nil then
            local sound = script.Seagull:Clone()
            sound.Parent = workspace
            sound:Play()
        end
    if game.Lighting.ClockTime <= 6 and game.Lighting.ClockTime >= 18 then
        if workspace:FindFirstChild("Seagull") ~= nil then
            workspace.Seagull:Destroy()
            end
        end
    end
end

thanks for reading

0
It might be a cloning issue, may I suggest using workspace.Seagull:Stop()? OrcaTheFish 95 — 5y

Answer this question