hi today i decided to start making a tower defense game.
i am following this tutorial by gnomecode:https://www.youtube.com/watch?v=R3AREWh14iQ&list=PLtMUa6NlF10fEF1WOeDtuGcIn0RdUNL7c
rn, at the part where i set the cframe of a copied zombie from server storage, only 1/2 zombies spawns in, the other is in workspace but just doesnt show up ANYWHERE
heres my script:
local ServerStorage = game:GetService("ServerStorage")
local mob = {}
function mob.Move(mob, map)
local humanoid = mob:WaitForChild("Humanoid")
local waypoints = workspace.Waypoints
for waypoint=1, #waypoints:GetChildren() do
humanoid:MoveTo(waypoints[waypoint].Position)
humanoid.MoveToFinished:Wait()
end
end
function mob.Spawn(name, map)
local mobExists = ServerStorage.Mobs:FindFirstChild(name)
if mobExists then
local newMob = mobExists:Clone()
newMob.HumanoidRootPart.CFrame = workspace.Map.SpawnBlock.CFrame
newMob.Parent = workspace
coroutine.wrap(mob.Move)(newMob, map)
else
warn("Mob could not be found!", name)
end
end
return mob
and
local mob = require(script.Mob)
local map = workspace.Map
for i=1, 2 do
mob.Spawn("Zombie", map)
wait(3)
end
thanks for any help