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

How to set extra health?

So, I'm making a game with specific player classes and to do that i use teams, since when they spawn they're gonna be assigned random classes.

Anyways i put this script in StarterPlayerScripts, so that if it'd work it would be easier for me to check the player's team

local Player = script.Parent
local humanoid = Player.Character.Humanoid 

humanoid.Health = humanoid.Health = 200
humanoid.MaxHealth = humanoid.MaxHealth = 200

But when i run the script it just doesn't set the player's maxhealth, and gives no errors in the output window.

Help?

1 comment

0

Accept @Gingerely's answer if it is correct please, so we know this question has been answered.

1 answer

✓ Accepted answer

The easiest way to do this is to put the script in StarterCharacter scripts and doing this

local Char = script.Parent
Char.Humanoid.MaxHealth = 200
Char.Humanoid.Health = 200

You also set the health the wrong way, humanoid.maxHealth = humanoid.MaxHealth = 200

3 comments

0

I tried your solution and it works, altough now I need a way to find the Player's team starting from it's character. Thanks anyways!

3

Could you accept the answer?

2

Click the checkmark next to my answer.

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