I have been trying to make a script that destroys the model it is in when a certain block is destroyed. When I destroy the block, it explodes like it is meant to, but the model isn't removed. So far I have got:
blueteamlive = script.Parent:FindFirstChild("Team Block")
while true do
if blueteamlive ~= nil then
game.Workspace.Spawns.Red = BrickColor.new(1001)
else
script.Parent:remove()
end
end
I have no idea if the script would work if nothing was inserted where I have put the Spawn brick color changer. I know something is wrong, but I don't know what. Can someone please help?

2 comments
How do insert my code properly? I couldn't find anything telling me how.
Just click the "Code Block" button when posting. And put your code(s) between the ~~~~~~~~~~~~~~~~~'s