Ive been trying to get my npc's to clone onto a part but they wont .please someone tell me im stupid and help me...in that order
01 | local ENEMY_COUNT = 25 |
02 |
03 | local ServerStorage = game.ServerStorage |
04 |
05 | local function spawnEnemies(count) |
06 | local spawnpoint = workspace.enemyspawn.Size |
07 |
08 |
09 | for i = 1 , count do |
10 |
11 | local enemy = ServerStorage.Enemies.Gladiator:Clone() |
12 | enemy.Parent = workspace.enemyspawn |
13 |
14 | local randomX = math.random(spawnpoint.X) |
15 | local randomZ = math.random(spawnpoint.Z) |
16 | enemy:MoveTo(Vector 3. new(randomX , 10 , randomZ)) |
17 | end |
18 | end |
19 | wait( 5 ) |
20 | spawnEnemies(ENEMY_COUNT) |
01 | local ENEMY_COUNT = 25 |
02 | local ServerStorage = game:GetService( 'ServerStorage' ) |
03 | local SpawnPoint = game:GetService( 'Workspace' ):WaitForChild( 'enemyspawn' ) |
04 | local enemies = ServerStorage:WaitForChild( 'Enemies' ) |
05 | local gladiator = enemies:WaitForChild( 'Gladiator' ) |
06 |
07 | local function spawnEnemies(count) |
08 | for i = 1 , count do |
09 | local EnemyClone = gladiator:Clone() |
10 | EnemyClone.Parent = SpawnPoint |
11 |
12 | EnemyClone:MoveTo(SpawnPoint.Position) -- Enemy must be a model with a primary part |
13 | end |
14 | end |
15 |
16 | spawnEnemies(ENEMY_COUNT) |