Hey friends,
Im working on spawning NPCs with a humanoid into my game, but unfortunately, they spawn with zero health and die instantaneously.
How would I fix that? Thanks!
Here's the script I use to spawn
I was trying to work with :MakeJoints(), but I did not understand it completely.
local Blob = game.ServerStorage.MiniEnemies.Blob:Clone() Blob:Clone() Blob:MakeJoints() Blob.Parent = game.Workspace Blob:MakeJoints() Blob.Humanoid.Health = 500
And I also have this
local boss = game.ServerStorage.ComputerVirus:Clone() boss:Clone() boss:MakeJoints() boss.Humanoid.Health = 10000000 boss.Attacks.Disabled = false boss.Humanoid.HumanoidS.Disabled = false boss.Parent = game.Workspace boss:MakeJoints()
Help appreciated!
There's several things you could try:
1st) Make their health infinite in the ServerStorage and once you clone them change their Health and MaxHealth to wanted amount, add a wait() and then clone them into the Workspace.
2nd) Give them a ForceField in ServerStorage, and disable all scripts when they spawn in, and after a wait() function enable them.
3rd) Make a re-spawn script that re-spawns the entity after they're cloned into Workspace. Assuming you don't want them to re-spawn after the player kills them, delete that script after it's served it's purpose
These are just some of the solutions I could think of. Not 100% sure if they will work but it's worth a shot. If you gave me more detail about the entities themselves I would gladly help you out.