Im Trying to make a Model that resembles multiple individual zombies move forward along with their legs swinging.
Here is the script.
--Spawn horde
function SleepingHorde()
local horde = game.ServerStorage.SleepingHorde
local hordecopy = horde:Clone()
hordecopy.Parent = game.Workspace
end
-- zombies wake up
function AwakenHorde()
local sleepinghorde = game.Workspace.SleepingHorde
local awakenhorde = game.ServerStorage.AwakenHorde
local hordecopy = awakenhorde:Clone()
sleepinghorde:Destroy()
hordecopy.Parent = game.Workspace
--they move
local place = CFrame.new(40,100.376,0.01)
local move = Vector3.new(1,0,0)
for count = 1, 200 do
wait(0.07)
place += move
hordecopy:SetPrimaryPartCFrame(place)
end
end
-- makes the legs animate
function legs()
wait(0.5)
local part = workspace.AwakenHorde.Legs:GetChildren()
while true do
for count = 1, 30 do
local rotation = part.CFrame * CFrame.Angles(0, 0, math.rad(1))
wait(0.05)
part.CFrame = rotation
end
for count = 1, 30 do
local rotation = part.CFrame * CFrame.Angles(0, 0, math.rad(-1))
wait(0.05)
part.CFrame = rotation
end
end
end
SleepingHorde()
wait(5)
legscorountine = coroutine.create(legs)
coroutine.resume(legscorountine)
AwakenHorde()
When i run it the zombies wake up fine and they start moving forward… BUT none of their legs move.
the legs() function works fine when used on a single part but not on a bunch of parts I just cant solve this. Any tips on what i could to to fix this? thanks.