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

The music w'ont stop when the player touch the part !!??

Asked by 5 years ago
script.Parent.Touched:Connect(function(part)
    for _, plr in ipairs(game:GetService("Players"):GetPlayers()) do
    if debounce == false then
        debounce = true
        IsAMusic = true
        if IsAMusic == true then
            game.ReplicatedStorage.RandomMusic.Music1:Stop()
            game.ReplicatedStorage.RandomMusic.Music2:Stop()
            game.ReplicatedStorage.RandomMusic.Music3:Stop()
            game.ReplicatedStorage.RandomMusic.Music4:Stop()
            game.ReplicatedStorage.RandomMusic.Music5:Stop()
            plr.Stats.Coins.Value = plr.Stats.Coins.Value + 7
            plr.Stats.XP.Value = plr.Stats.XP.Value + 13
            plr.Character.Humanoid.WalkSpeed = 16
            plr.Character:SetPrimaryPartCFrame(lobbyTP.CFrame)
            game.ReplicatedStorage.Winner:Play()
            wait(1)
            IsAMusic = false
        end
        debounce = false
    end

    end
end)


1
IsAMusic returned false on the touched event then. User#19524 175 — 5y

Answer this question