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

Zombie Wave Cloning Script Issue?

Asked by
Bman8765 270 Moderation Voter
9 years ago

So I have a script in workspace that will clone zombies to a certain point in wave increments (every wave spawns more zombies) the problem is when I tested this as soon as the zombies teleport they die, is there any suggestions on how to fix this. I use MoveTo:() for teleporting the zombies and then I teleport their model. If you have any suggestions please tell me. Here is the code: (random map basically picks a randomap to spawn which is done above this, it is not important but when teleporting them they must teleport to [randommap].ZombieSpawn1)

The variable zombie found in local zombieclone = zombie:clone() is game.Lighting.Zombie

repeat wait(10)
    local wavenum = script.Wave
    wavenum.Value = wavenum.Value +1
    topgui.Value = "Wave " ..wavenum.Value.. "!"
    local zoms = math.random(5,10)
    local zomsfinal = zoms*wavenum.Value
    for spawn1 = 0, zomsfinal do
        local zombieclone = zombie:clone()
        zombieclone.Parent = game.Workspace[randommap]
        zombieclone:MoveTo(game.Workspace[randommap].ZombieSpawn1.Position)
        print("zombiespawn1 spawned")
        wait(2)
    end
until gameover.Value == true
0
Post where randommap is defined. Perci1 4988 — 9y

1 answer

Log in to vote
0
Answered by
Shawnyg 4330 Trusted Badge of Merit Snack Break Moderation Voter Community Moderator
9 years ago

You need to use the MakeJoints method to well, make its joints! When cloning a model that contains parts within it, you need to bond all of its joints back together!

repeat wait(10)
    local wavenum = script.Wave
    wavenum.Value = wavenum.Value +1
    topgui.Value = "Wave " ..wavenum.Value.. "!"
    local zoms = math.random(5,10)
    local zomsfinal = zoms*wavenum.Value
    for spawn1 = 0, zomsfinal do
        local zombieclone = zombie:clone()
    zombieclone:MakeJoints()
        zombieclone.Parent = game.Workspace[randommap]
        zombieclone:MoveTo(game.Workspace[randommap].ZombieSpawn1.Position)
        print("zombiespawn1 spawned")
        wait(2)
    end
until gameover.Value == true

0
This almost works. It looks like all the joints are "joined" except for the head. Whenever it clones the head goes flying off the body while everything else stays together, any advice? Bman8765 270 — 9y
0
normal humanoid objects have special snaps made, not dj BlueTaslem 18071 — 9y
0
Normal humanoid objects get special snaps made for all their joints. MakeJoints only make joints represented by the surfaces of parts. Make sure the bottom of the head has a compatible surface to join to the top of the torso and that they are in contact BlueTaslem 18071 — 9y
0
All parts appear to have the proper surfaces... Bman8765 270 — 9y
Ad

Answer this question