So I'm making a script where if a model's health hits 0, the script resets the game. But the script is skipping the line where it makes the model's health 5000. Help~!
Also another script I had that uses this kinda code works fine, it's just this one..
game.Workspace.Helicopter_.Humanoid.Died:Connect(function()
game.Workspace.Intel.IntelBlock.Transparency = 0
game.Workspace.Intel.IntelBlock.CanCollide = true
game.Workspace.Intel.IntelBlock.ClickDetector.MaxActivationDistance = 8
game.Workspace.Intel.GUI.BillboardGui.TextLabel.Text = "Intel"
game.Workspace.Helicopter_.Humanoid.Health = 5000 -- skips this line
print("yesssss")
for _, v in pairs(game.Players:GetChildren()) do
v:LoadCharacter()
end
wait(.1)
game.ReplicatedStorage.IntelStolen:FireAllClients()
for _, v in pairs(game.Workspace:GetChildren()) do
if v.Name == "Russian Soldier" or v.Name == "American Soldier" then
v:Destroy()
end
end
wait(.1)
for _, v in pairs(game.Workspace:GetChildren()) do
if v.Name == "Ragdoll_" then
v:Destroy()
end
end
wait(3)
for _, v in pairs(game.ServerStorage:GetChildren()) do
if v.Name == "Russian Soldier" or v.Name == "American Soldier" then
local klone = v:Clone()
klone.Parent = workspace
wait(.1)
end
end
print("?????????")
end)

3 comments
Are there any errors? Did you make sure that you are changing the health for the right thing?
Are there any errors? Did you make sure that you are changing the health for the right thing?
No errors.