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

How can I add new stats for player?

Asked by 5 years ago

I want to add new statistics to the player, such as strength, speed, and those; as it is with health. Ex:

Health: 100 Max.Health: 100 Power: (Number) Speed ....

and the others. I'm trying to add them to Humanoid, but I don't know how to do it.

1 answer

Log in to vote
0
Answered by
acuaro 29
5 years ago

You could first, reference the humanoid, then use Instance.new to create IntValues. Here is a sample code below

1local hum = --put reference to the humanoid here
2 
3local hp = Instance.new("IntValue", hum)
4hp.Name = "Health"
5hp.Value = hum.Health.Value
6 
7local power = Instance.new("IntValue", hum)
8power.Name = "Power"
9power.Value = --Insert the area to get to the players Power

Hope I could help!

Ad

Answer this question