Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

Health gaining GamePass says nothing in output, yet doesn't work?

I'm trying to make a GamePass that makes you invincible, but it just doesn't do anything. I tried (awfully) to create a loop, but no dice. It's a server script in ServerScriptService. Here's my script:

game.Players.PlayerAdded:connect(function(player)

player.CharacterAdded:connect(function(character)

if game:GetService("MarketplaceService"):UserOwnsGamePassAsync(player.UserId,6407448) then

player.character.Humanoid.Health = 9999999999

if character.Humanoid.Health == 100 then

print(character.Humanoid.Health)

end

end

end)

end)

1 answer

✓ Accepted answer

it doesnt do anything since ur not changing the max health and if u rlly want the person to be invincible then a better way to do this is by doing character.Humanoid.Name = "whatever u want here" or u could do

character.Humanoid.MaxHealth = 99999999999999
while true do
character.Humanoid.Health = character.Humanoid.MaxHealth
end

not sure if renaming the humanoid will work but the other way defintly will

This discussion is preserved as it was. New answers, comments, and votes are closed.