--dynamite

local previousExplodedCart
for i, y in pairs(game.Workspace.ActivationThings.Explosions:GetChildren()) do
	if y:IsA("BasePart") then
		y.Touched:Connect(function(hit)
			local cart
			if hit and hit.Parent and hit.Parent.Parent and hit.Parent.Parent:IsDescendantOf(workspace.Carts)	then
				cart = hit.Parent.Parent
			elseif hit and hit.Parent and hit.Parent.Parent.Parent and hit.Parent.Parent.Parent:IsDescendantOf(workspace.Carts) then
				cart = hit.Parent.Parent.Parent
			end
			if cart and previousExplodedCart ~= cart then
				previousExplodedCart = cart
				funThings.ExplodeCart(cart)
			end
		end)
	end
end


