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

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

Asked by 5 years ago

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

Log in to vote
1
Answered by 5 years ago

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

Ad

Answer this question