local function j(j)local Z=Vector3.new(0,0,0)local h=3 if j:IsA("\077\111\100\101\108")and j.PrimaryPart then local n=j.PrimaryPart Z=n.Position h=1*n.Size.X else Z=j.Position h=1*j.Size.X end local n=Instance.new("\080\097\114\116")n.Name="\083\109\111\107\101\080\097\114\116"n.Transparency=1 n.CanCollide=false n.Anchored=true n.Position=Z+Vector3.new(0,1,0)n.Size=Vector3.new(1,1,1)n.Parent=mapManager.getMap()local W local S=math.random(1,3)if S==1 then W=ServerStorage.CrushSound1:Clone()elseif S==2 then W=ServerStorage.CrushSound2:Clone()elseif S==3 then W=ServerStorage.CrushSound3:Clone()end W.Parent=n if not W.IsLoaded then W.Loaded:wait()end W:Play()local f=Instance.new("\083\109\111\107\101")f.Parent=n f.RiseVelocity=0 f.Size=h DebrisService:AddItem(n,2)end
-- Create smoke for specified part (being destroyed)
local function createSmoke(targetPart)
	local pos = Vector3.new(0, 0, 0)
	local size = 3
	if targetPart:IsA("Model") and targetPart.PrimaryPart then
		--local plate = targetPart:FindFirstChild("Plate", true)
		local plate = targetPart.PrimaryPart
		pos = plate.Position
		size = 1 * plate.Size.X
	else
		pos = targetPart.Position
		size = 1 * targetPart.Size.X
	end

	local smokePart = Instance.new("Part")
	smokePart.Name = "SmokePart"
	smokePart.Transparency = 1
	smokePart.CanCollide = false
	smokePart.Anchored = true
	--smokePart.Position = getPositionRelativetoBase(smokePart, pos) + Vector3.new(0, 1, 0)
	smokePart.Position = pos + Vector3.new(0, 1, 0)
	smokePart.Size = Vector3.new(1, 1, 1)
	smokePart.Parent = mapManager.getMap()

	local crushSound
	local randomNum = math.random(1, 3)
	if randomNum == 1 then
		crushSound = ServerStorage.CrushSound1:Clone()
	elseif randomNum == 2 then
		crushSound = ServerStorage.CrushSound2:Clone()
	elseif randomNum == 3 then
		crushSound = ServerStorage.CrushSound3:Clone()
	end
	crushSound.Parent = smokePart
	if not crushSound.IsLoaded then
		crushSound.Loaded:wait()
	end
	crushSound:Play()

	local smoke = Instance.new("Smoke")
	smoke.Parent = smokePart
	smoke.RiseVelocity = 0
	smoke.Size = size

	DebrisService:AddItem(smokePart, 2)
end
