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

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

Asked by 7 years ago

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

0
Where is your code? We can't help without you trying! starlebVerse 685 — 7y
0
Right now all I have is a GUI script that displays the health Michael_TheCreator 166 — 7y
0
Stat = script.Parent.Parent.Parent.Parent.Parent.leaderstats.Health while true do wait(2) script.Parent.Text = "Health:" ..Stat.Value end Michael_TheCreator 166 — 7y
0
It's more efficient to use a IntConstrainedValue Filipalla 504 — 7y

1 answer

Log in to vote
2
Answered by 7 years ago
Edited 7 years ago

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.

0
Why do that when all you have to do is use .Changed? SimplyRekt 413 — 7y
0
Thank you Michael_TheCreator 166 — 7y
0
Yeah no problem. MrLonely1221 701 — 7y
Ad

Answer this question