#Cloning Issue

14 messages · Page 1 of 1 (latest)

small cape
#

I am a pretty new scripter. I understand the basics of most mechanics due to hours of youtube tutorials on what different things did. I am trying to make a lumberjack type of game where the trees respawn in random places after x amount of them have been chopped down. I can seem to make the tree spawn in the area I assign it but instead in its original position before I put it in server storage. I can't tell if I am doing something wrong when I clone it or when I position it.

local treeCopy = game.ServerStorage["Pine Tree"]:Clone()
treeCopy.Parent = game.Workspace

local randomX = math.random(60.5, 84.5)
local randomZ = math.random(56.5, 32.5)

treeCopy.Position = Vector3.new(randomX, 2, randomZ)

simple cradle
#

so where is it supposed to be

small cape
#

In the red zone

simple cradle
#

the tree

small cape
#

Yeah

languid arrow
languid arrow
#

Check the tree’s position

#

Is it inside the window given

#

(
e.g.:
Tree.Position.X being 40 is not good
it being 80 is good)

lunar rampart
#

@small cape im no pro but u could try this: Vector3.new(math.random(60.5, 84.5), 100, math.random(56.5, 32.5)) and also assign a primary part

winged anvilBOT
#

studio** You are now Level 3! **studio

languid arrow
lunar rampart
#

like i said, im no pro but i have created a script like that before