no i mean like put it inside the script where the trees generate so something like this
local tree = treeModel:Clone()
local cd = tree:FindFirstChild("Click"):FindFirstChild("ClickDetector")
if cd then
cd.MouseClick:Connect(function()
if tree then
tree:Destroy()
end
end)
end
paintTreeLeaves(tree)
tree:SetPrimaryPartCFrame(cf(posGrid[x][z])
* cfAngles(0, noise(x/7, z/7, SEED * 2) * 10, 0)
* cf(noise(x*5.4, z*5.4, SEED*2) * TREE_OFFSET, 0, noise(x*5.4, z*5.4, SEED*2) * TREE_OFFSET)
)
tree.Parent = workspace
insert(instances, tree)