--wood

for i, x in pairs(game.Workspace.ActivationThings.Other.WoodPlanks:GetChildren()) do
	if x:IsA("BasePart") then
		x.Touched:Connect(function(hit)
			if deb then return end
			if hit and hit.Parent and hit.Parent.Parent and hit.Parent.Parent:IsDescendantOf(workspace.Carts) 
				or hit and hit.Parent and hit.Parent.Parent.Parent and hit.Parent.Parent.Parent:IsDescendantOf(workspace.Carts) then	
				deb = true
				for i, v in pairs(x.Parent:GetChildren()) do
					if v:IsA("Sound") then
						v:Play() continue
					end
					local lastPos = v.CFrame
					v.Anchored = false

					local function fade(part: BasePart)
						for i = 1, 10 do
							part.Transparency = i / 10
							if part.Transparency == 1 then
								part.CanCollide = false
								wait(2)
								part.Anchored = true
								part.Transparency = 0
								wait(8)
								game:GetService("TweenService"):Create(part, TweenInfo.new(1), {CFrame = lastPos}):Play()
								part.CanCollide = true
								part.AssemblyAngularVelocity = Vector3.new(0, 0, 0)
								wait(1)
								if deb then
									deb = false
								end
							end
							wait(0.1)
						end
					end

					task.delay(3, function()
						coroutine.wrap(fade)(v)
					end)

				end
			end
		end)
	end
end
