Script won't work unless a function that does literally nothing is in the script

Hello everyone, I have a script that checks if an object is already in the place where the player is trying to place the part. it is in a server script:

local Touching_Parts =clone.Wall:GetTouchingParts()

	for _, v in pairs(Touching_Parts) do
		if v then
			event:FireClient(Player,v)
			
			return
		end
	end

However, it will only detect the tree trunk as touching if there is the script


script.Parent.Touched:Connect(function(hit)

end)

I don’t understand why it only works if a function that does literally nothing is present in a script that is parented to the tree trunk.****

It actually does something,

You are using this trick of the Roblox engine: