Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

Help With Cloning Zombies?

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?

2 comments

0

Is the zombie's health at 0?

0

no

1 answer

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.

This discussion is preserved as it was. New answers, comments, and votes are closed.