hi there, thanks for clicking here, i have one problem with script. its about randomly spawning parts on the map but its not working. Script location; ServerScriptService Code:
`local desiredTrees = 100
local TreeModel = game.Workspace.Wood
for i = 1, desiredTrees, 1 do
wait()
local wood = TreeModel:Clone()
wood.Parent = workspace
local Height = 5
wood.PrimaryPart = wood.MeshPart
wood:SetPrimaryPartCFrame(CFrame.new(Vector3.new(math.random(-157, 249),Height, math.random(-157, 249))))
for i, v in pairs(wood:GetDescendants()) do
if v:IsA("BasePart") then
for ii, vv in pairs(v:GetTouchingParts()) do
if wood and not vv:FindFirstAncestor(wood) then
wood:Destroy()
break
end
end
end
end
end`