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?
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.