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

Help With Cloning Zombies?

Asked by
Scootakip 299 Moderation Voter
8 years ago
local zombie = game.Workspace.Adopt.Zombie:Clone()
    zombie:MakeJoints()
    zombie.Owner.Value = game.Players.LocalPlayer.Name
    zombie.Parent = game.Workspace.Zombies
    zombie.Torso.CFrame = CFrame.new(game.Workspace.Adopt.Toucher.Position + Vector3.new(0,5,-10))

This script basically teleports a clone of the zombie model in Replicated Storage, but for some reason whenever I'm in server testing the zombies spawns and instantly dies for basically no reason. In offline testing everything works, but in servers it spawns and then immediately dies. Some help?

0
Is the zombie's health at 0? DevNetx 250 — 8y
0
no Scootakip 299 — 8y

1 answer

Log in to vote
-1
Answered by 8 years ago

You could try running the script without MakeJoints() as sometimes if you use it and the joints are already fine, it can kill the humanoid. If that doesn't work, you could also try healing the zombie directly after it spawns.

local zombie = game.Workspace.Adopt.Zombie:Clone()
zombie:MakeJoints()
zombie.Owner.Value = game.Players.LocalPlayer.Name
zombie.Parent = game.Workspace.Zombies
--wait(0.1) -- May help keep it from dying.
zombie.Torso.CFrame = CFrame.new(game.Workspace.Adopt.Toucher.Position + Vector3.new(0,5,-10))
zombie["Humanoid"].Health = zombie["Humanoid"].MaxHealth -- Heals zombie fully.

If you found my answer helpful, consider giving me an upvote and checking out Roblox Guides. If it was hard to understand or you have any questions, feel free to contact me.

Ad

Answer this question