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

How could I create a health system based off an IntValue?

Can anyone tell me how I could create a health system based off an IntValue?

4 comments

0

Where is your code? We can't help without you trying!

0

Right now all I have is a GUI script that displays the health

0

Stat = script.Parent.Parent.Parent.Parent.Parent.leaderstats.Health while true do wait(2) script.Parent.Text = "Health:" ..Stat.Value end

0

It's more efficient to use a IntConstrainedValue

1 answer

✓ Accepted answer

The easiest way to do this is is by using a LocalScript and RunService

**LocalScript **

local player = game.Players.LocalPlayer;
local stat = player.leaderstats.Health;

stat.Changed:connect(function()
	script.Parent.Text = "Health: " .. stats.Value;
end);

I hope this helped. If it did please accept this as the answer. If it didn't please feel free to ask any questions you have.

3 comments

0

Why do that when all you have to do is use .Changed?

0

Thank you

0

Yeah no problem.

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