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

How to make a HealthBar(number) that rounds to a whole number?

Asked by 5 years ago

THis must be easy since other people do it, please answer this thx guys :)

2 answers

Log in to vote
0
Answered by 5 years ago
Edited 5 years ago

The following can make a number value that includes a decimal into an integer

math.floor(number) -- Rounds a number down

OR

math.ceil(number) -- Rounds a number up

Whole numbers are technically only positive, so you can also use

math.abs(number) -- Takes the absolute value
0
Well thank you, I had no idea about math.ceil! IDKBlox 349 — 5y
0
thx CommanderCaubunsia 126 — 5y
Ad
Log in to vote
1
Answered by
IDKBlox 349 Moderation Voter
5 years ago

math.floor(health)

0
Alright! ill give it to you, that is only true ;) CommanderCaubunsia 126 — 5y
0
explain anything? you literally asked how to round to a whole number... math.floor() rounds to a whole number o.O IDKBlox 349 — 5y
0
@Commander, Don't say "boo" to people trying to help you noob. IDKBlox gave enough information. ShadyShock 77 — 5y
0
I gotchu <3. Simple explanations for a simple inquirey. CorruptScript 86 — 5y

Answer this question