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

How do I play victory music when the tank is killed?

I am making a zombie game and at the last part of the game there is a tank and I wanna know how to do it so that the when everyone kills the tank victory music plays. The tank already has a script that destroys it from the workspace and also I don't want any while true do scripts :)

1 answer

You can put a script inside the tank that runs a Humanoid.Died function

local Humanoid = script.Parent.Humanoid

Humanoid.Died:Connect(function()
	--play the victory music
end)

2 comments

0

I am not sure if that will work because I have a long script but ill show you parts of it (not all) script.Message.Text = "Radio: I will explode the wall." game.Workspace.Explode:Play() wait(10) script.Message.Text = "Ummm why is there a tank here!?!?!?" wait(3) script.Message.Text = "Radio: Umm the tank is blocking the helicopter" wait(3) script.Message.Text = "Radio: Ill raise the helico

0

its only gonna run if the scripts parent dies so it should work

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