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

This sound script is not working at the end, how do I fix this?

Asked by 5 years ago
Edited 5 years ago

Okay so the first two chunks work but the 3rd one? Not a single thing happens. Also, there are no errors being shown from the studio.

wait(1)
function onClick()
    script.Parent.Sound:Play()
    wait(.1)
    if game.workspace.Scripts.Music.BackgroundMusic.TestZone2.Music.Sound.Playing == false then --water off, turn on
         game.workspace.Scripts.Music.BackgroundMusic.TestZone2.Music.Sound.Playing = true
        game.Workspace.MapContents.Rain_Fall.Rain1.Enabled = true
    game.Workspace.MapContents.Rain_Fall.Rain2.Enabled = true
    game.Workspace.MapContents.Rain_Fall.Rain3.Enabled = true
    game.Workspace.MapContents.Grass.RainDrop1.Enabled = true
    game.Workspace.MapContents.Grass.RainDrop2.Enabled = true
    game.Workspace.MapContents.Grass.RainDrop3.Enabled = true
    game.Workspace.MapContents.GrassColor.Transparency = .8
elseif
        game.Workspace.Scripts.Music.BackgroundMusic.TestZone2.Music.Sound.Playing == true then --water on, turn off, turn snow on
        game.Workspace.Scripts.Music.BackgroundMusic.TestZone4.Music.Sound.Playing = true
        game.Workspace.Scripts.Music.BackgroundMusic.TestZone2.Music.Sound.Volume = 0
    game.Workspace.MapContents.Rain_Fall.Rain1.Enabled = false
    game.Workspace.MapContents.Rain_Fall.Rain2.Enabled = false
    game.Workspace.MapContents.Rain_Fall.Rain3.Enabled = false
    game.Workspace.MapContents.Grass.RainDrop1.Enabled = false
    game.Workspace.MapContents.Grass.RainDrop2.Enabled = false
    game.Workspace.MapContents.Grass.RainDrop3.Enabled = false
    game.Workspace.MapContents.Snow.SnowFall.Enabled = true
    game.Workspace.MapContents.GrassColor.Transparency = 1
elseif
         game.Workspace.Scripts.Music.BackgroundMusic.TestZone2.Music.Sound.Volume == 0 then --snow on, turn off
            game.Workspace.Scripts.Music.BackgroundMusic.TestZone4.Music.Sound.Playing = false
            game.Workspace.Scripts.Music.BackgroundMusic.TestZone2.Music.Sound.Volume = 1
            game.Workspace.Scripts.Music.BackgroundMusic.TestZone2.Music.Sound.Playing = false
            game.Workspace.MapContents.Snow.SnowFall.Enabled = false
            end
end
script.Parent.ClickDetector.MouseClick:Connect(onClick)
0
Do you get any errors? If so, could you please add them? Thanks. ^^ TheWaterFoox 255 — 5y
0
Theres no errors, thats why Im so confused. User#23462 0 — 5y
0
Is your script disabled?? CPF2 406 — 5y

Answer this question