Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

Will someone please help me figure out why the model won't move?

I'm making a randomly generated map that places nodes randomly throughout the map that will place down trees but it will not work for some odd reason the tree moves to the workspace but then the position doesn't change i've tried using :MoveTo and TranslateBy and both didn't work

http://www.roblox.com/Generation-System-place?id=192403853

heres the game its uncopylocked so you can see the code

node placing script

while wait(0.15) do 
	if game.Workspace.Nodes.Value < 75 then
		
script.Choose.Value = math.random(1, 2)

if script.Choose.Value == 1 then
local test = game.Lighting.Spawn:Clone()
test.Parent = game.Workspace
game.Workspace.Nodes.Value = game.Workspace.Nodes.Value +1
test.Position = Vector3.new(math.random(1, 148),-8.5, math.random(-148, -1))
else
local test2 = game.Lighting.Spawn2:Clone()
game.Workspace.Nodes.Value = game.Workspace.Nodes.Value +1
test2.Parent = game.Workspace
test2.Position = Vector3.new(math.random(1, 148),-8.5, math.random(-148, -1))	
end

	else
		end
end

script that spawns the tree

local Spawn2 = script.Parent
local tree = game.Lighting.Tree:Clone()
wait(1)
tree.Parent = game.Workspace
wait(1)
tree:TranslateBy(Vector3.new(script.Parent.Position))

if anyone could please help me figure this out that'd be great

3 comments

0

Moveto() is for Humanoids.

0

No it's not.

0

Mu6666mu, the 'MoveTo' method can be used for 'Humanoid' type instances, aswell as 'Model' type instances. :P

1 answer

change tree:TranslateBy(Vector3.new(script.Parent.Position)) to tree:MoveTo(script.Parent.Position)

This discussion is preserved as it was. New answers, comments, and votes are closed.