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

[Really stupid and easy to fix probably] Why is the zombie not spawning in this area?

Asked by 3 years ago

so the zombie spawns where the zombie is in ReplicatedStorage and not the Local Position

local enemy = game.ReplicatedStorage.Zombie

local function create()
    local position = Vector3.new(90, 500, 400)
    local copy = enemy:Clone()
    copy.Parent = game.Workspace
    enemy:MoveTo(position)

end

while true do
    create()
    wait(1)

end
0
because ur moving the enemy not the copy on line 7 do copy:MoveTo(position) greatneil80 2647 — 3y

1 answer

Log in to vote
0
Answered by 3 years ago

Hello!

The problem seems to be the fact that you are trying to move the "enemy" variable which is in ReplicatedStorage, you need to replace "enemy:MoveTo(position)" with "copy:MoveTo(position)".

The code should work when it will be like that:

local enemy = game.ReplicatedStorage.Zombie

local function create()
    local position = Vector3.new(90, 500, 400)
    local copy = enemy:Clone()
    copy.Parent = game.Workspace
    copy:MoveTo(position)

end

while true do
    create()
    wait(1)

end
Ad

Answer this question