Hello, so, this might sound derp, but let’s say I am an ‘intermediate/beginner’ scripter, so, I never learned about Well, like, CFrames, vectores, math.rad, math.sin, math.cos and etc… I just don’t get it and I’m bad with maths lol, so, how can I make a health bar according to player health, I think it would be like the humanoid health / humanoid maxhealth and the size of bar? I just, don’t know how to make stuff like that!! Apologies, I will try to learn about CFrames and math.rad cos sin tan and more. Thanks
You don’t need really any math. If all you want is a healthbar, set the size of the bar to their health divided by their max health. So like:
hpBar.Size = Udim2.new(humanoid.Health / humanoid.MaxHealth, sizeXoffset, sizeYscale, sizeYoffset) -- You can also tween.
Then check when their health changes.
humanoid.HealthChanged:Connect(function(newHealth)
--Sure you know what to do from here!
end)
Thank you! I just didn’t understand, like,
What’s * or /
> print(2/1)
2
> print(2/1)
2
> print(3/1)
3
> print(3/3)
1
So / Divides
and * multiplies?
THank you, I just didn’t know how to, so then, what would I use, math for? like for doing something similar?
I saw like, to make a counter like this
5:30
What does % do?
It was like: math.floor(timeStat.Value/60) … “:” … (“0”…(timeStat.Value % 60)):sub(-2)
Is there a tutorial for this?
% is just a basic operator to divide the left operator by the right operator and return the remainder of that.