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

Why does my Nexus have 0 health when he spawns?

Asked by
OniiCh_n 410 Moderation Voter
10 years ago

I have a Nexus model that has health while it is in ReplicatedStorage. But after being cloned to Workspace, the Nexus has 0 health.

When it has just a Head part, it has health.

But upon adding a Torso part, it has 0 health.

Is there something wrong with my script?

local nexus = game.ReplicatedStorage.Nexus
local currentRound = 1

function spawnNexus()
    newNexus = nexus:Clone()
    newNexus:makeJoints()
    newNexus.Parent = game.Workspace
    newNexus.Humanoid.Health = (currentRound * 70) + 30
    newNexus.Humanoid.MaxHealth = newNexus.Humanoid.Health
    newNexus:makeJoints()
    newNexus:makeJoints()
    print(newNexus.Humanoid.Health)
    print(newNexus.Humanoid.MaxHealth)
end

wait(10)
spawnNexus()

Image of Nexus after spawn w/ Torso part

1 answer

Log in to vote
0
Answered by
LevelKap 114
10 years ago

i don't know much about the topic of replicated storage, but you are about the fourth person who has had trouble with health in humanoids when cloned and placed outside of replicated storage. I'm sure it's just a bug.

0
It's not a bug. I fixed it once with an actual model that looked like a Player, but for some reason it won't work with this one. OniiCh_n 410 — 10y
Ad

Answer this question