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

boss wont spawn enemies on its position,how do i fix it?

Asked by 4 years ago

Longer title: the Boss im trying to make is not spawning its enemies on its own position,instead is spawning it in a specific area instead,how do i fix it so that it spawns itself on its own positions instead?

The code is not mine,but i try to learn code by editing it,for me i don't know what to edit for the enemies to spawn at the same position as the original enemy,the "children" is the enemies the boss will spawn if it dies

local hum = script.Parent
local children = game.Lighting.Zombies.Minis:clone()

hum.Died:connect(function()
    wait(0.01)
    children.Parent = hum.Parent.Parent
    children:makeJoints()
    hum.Parent:Destroy()
end)

1 answer

Log in to vote
1
Answered by 4 years ago

you have to set the Vector3 value of the zombie when it is cloned. since you are cloning the zombie, and then setting the parent of the zombie to the Boss with out telling roblox where you want them to spawn. because of this roblox positions them at 0,0,0 in most cases. if you want to make the zombies spawn at the position of the boss then do. zombie.Position = boss.position. since you are very new to scripting i suggest you don't learn that way as it is very slow and inefficient. watch youtube tutorials and read articles it will save you alot of time.

Ad

Answer this question