I am making a game for my mother and seeing if she likes it. I need to clone trees because the setting is going to be in the forest.
✓ ANSWER ACCEPTED
I'm trying to clone a tree model but I can't figure out how. Please help??
3 answers
✓ Accepted answer
If you need to clone a tree, you first need a model, which I think you should have. Then in order to clone the tree using a script, you can do the following.
--Place the model of the tree in ServerStorage
--Then add a script in ServerScriptStorage or Workspace, either of them works.
local ServerStorage = game:GetService("ServerStorage")
local Tree = ServerStorage:WaitForChild("Tree") --I am going to assigning a variable name to your tree, I will be calling it "Tree".
local treeAmount = 10 --Lets spawn 10 trees, you can change it anytime.
local treeSpawned = 0
while treeSpawned < treeAmount do
local treeClone = Tree:Clone() --Clone the tree from ServerStorage
--You would want your trees to be in different positions, so generate a set of numbers.
local randX = math.random(-50, 50)
local randZ = math.random(-50, 50)
--Set position and parent the tree to the workspace.
treeClone:SetPrimaryPartCFrame(CFrame.new(randX, 0, randZ)) --You can set the tree's position using this method.
treeClone.Parent = workspace
treeSpawned = treeSpawned + 1
wait()
end
Select the tree then press ctrl and d at the same time. Then it will clone the tree
2 comments
0
I mean in scripts, that would take too long.
0
Oh, Then idk.
I decided to give up, all I did was duplicate it.
This discussion is preserved as it was. New answers, comments, and votes are closed.

5 comments
That seems hard
What exactly do you want the script to do? Do you want it to clone one tree? If you can provide a bit more detail, maybe I can help more on the problem.
I don't really know how to provide more detail, I just started all this scripting and stuff. I want to spawn them in rows using scripts and from there I can scatter them around the map.
Also I tried what you showed, I didn't work.
You're tree is a model right? You also have to set a primary part to your model, to do this, can choose the base of your tree as the primary part. Click you your model, and one of the properties are called "Primary Part", click on it and click on the base of your tree.