I am making a zombie game and I want to know how to make it so that then the Tank Zombie is defeated victory music starts playing and whatever. I tried making a script for it but it didn't work. Here is the script:
if not game.Workspace:FindFirstChild("Tank")then game.Workspace.Tank1Music:Stop() game.Workspace.VictoryMusic:Play() end
Hello, the zombie still stays in workspace, so I just recommend doing this:
debounce = true while true do wait() if workspace.Tank:FindFirstChild("Humanoid").Health < 1 and debounce then debounce = false workspace.Tank1Music:Stop() workspace.VictoryMusic:Play() end end
I’ve also added a while true do loop. Hope it helps