Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

How do I make it so that music starts playing when Tank zombie is defeated?

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

1 answer

✓ Accepted answer

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

2 comments

0

Wow this worked thanks :3

0

Np!

This discussion is preserved as it was. New answers, comments, and votes are closed.