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

MoveTo won't work?

Asked by 9 years ago

Long story short, MoveTo won't move the model that spawns.

local bs = game.Workspace.battlestart

bs.Changed:connect(function()
    if bs.Value == "true" then
        wait(1)
        local enemy = game.ReplicatedFirst.Enemies:FindFirstChild(game.Workspace.battlestart.enemy1.Value)
        enemy:Clone().Parent = game.Workspace
        enemy:MoveTo(Vector3.new(game.Workspace.Arena.EnemySpawns.I))
    end
end)

Nothing is showing up in Output, either. The whole script works, except for the part that moves the model. I'm sure that I'm just making a stupid mistake, but I cannot seem to catch it. All help is appreciated.

0
try printing game.Workspace.Arena.EnemySpawns.I bubbaman73 143 — 9y

1 answer

Log in to vote
1
Answered by
Tigerism 220 Moderation Voter
9 years ago

MoveTo() needs a valid position.

Code:

enemy:MoveTo(game.Workspace.Arena.EnemySpawns.I.Position)

0
Ah, I knew I made a stupid mistake! Thanks! :D ZeMeNbUiLdEr 104 — 9y
Ad

Answer this question