I am making a script, it spawns enemies in waves! It works the first time... but after that I get an error saying "Unable to cast double Vector3"! Here is my script
function goSpawn()
local posx = math.random(-254,254)
local posz = math.random(44,255)
local larva = game.ReplicatedStorage.Alien:clone()
larva.Parent = workspace
larva:MoveTo(posx,5,posz)
end
if script.Parent.WaveCount.Value == 1 then
wait(5)
goSpawn()
wait(1)
goSpawn()
wait(1)
goSpawn()
wait(1)
goSpawn()
wait(1)
goSpawn()
wait(1)
goSpawn()
wait(1)
goSpawn()
wait(1)
goSpawn()
wait(1)
goSpawn()
wait(1)
goSpawn()
end
Please help!!! Thank you!!!

1 comment
Thank you so much! I understand why it didn't work! THANKS