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 4 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
4 years ago

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

local hum = --put reference to the humanoid here

local hp = Instance.new("IntValue", hum)
hp.Name = "Health"
hp.Value = hum.Health.Value

local power = Instance.new("IntValue", hum)
power.Name = "Power"
power.Value = --Insert the area to get to the players Power

Hope I could help!

Ad

Answer this question