Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

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

Asked by
Prioxis 673 Moderation Voter
10 years ago

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

0
Moveto() is for Humanoids. Orlando777 315 — 10y
0
No it's not. Muoshuu 580 — 10y
0
Mu6666mu, the 'MoveTo' method can be used for 'Humanoid' type instances, aswell as 'Model' type instances. :P TheeDeathCaster 2368 — 10y

1 answer

Log in to vote
1
Answered by
Muoshuu 580 Moderation Voter
10 years ago

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

Ad

Answer this question