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

How can i change max health?

Asked by 5 years ago

How can i change max health?

local id = 7721102

game:GetService("MarketplaceService").PromptGamePassPurchaseFinished:Connect(function(plr,ido,purchased)
    if purchased and ido == id then
        plr.Character.Humanoid.h.Health = 200
    end
end)

game.Players.PlayerAdded:Connect(function(plr)
    plr.CharacterAdded:connect(function(char)
        if game:GetService("MarketplaceService"):UserOwnsGamePassAsync(game.Players[char.Name].UserId, id) then
            char.Humanoid.h.Health = 200
        end
    end)
end)

1 answer

Log in to vote
0
Answered by 5 years ago

Something like this...?

char.Humanoid.MaxHealth = 1000
char.Humanoid.Health = char.Humanoid.MaxHealth
Ad

Answer this question