local function G(G,R)local function d(d)local q=d.Parent local E=q:FindFirstChildWhichIsA("\072\117\109\097\110\111\105\100")if E then E:TakeDamage(R)G:Destroy()end end attachCollisionFunction(G,d)end
-- Creates the collision function to attach to the object
local function setupFallingObjectCollisions(object, damage)
	-- The collision function; must be declared in this scope as it needs reference to "object" and "damage" params
	local function onTouch(otherObject)
		local character = otherObject.Parent
		local humanoid = character:FindFirstChildWhichIsA("Humanoid")
		if humanoid then
			humanoid:TakeDamage(damage)
			object:Destroy()
		end
	end

	-- Attach the above function to the falling object
	attachCollisionFunction(object, onTouch)
end
