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

How would I convert Parts/TotalParts into a percentage?

Asked by
LawlR 182
5 years ago

I've made a script that loads a map and shows how many parts are loaded out of how many parts there are in the map. I've decided I want to change it so that it shows the percentage loaded, but I need help since I have no idea how to do that. Here is what I have now:

https://gyazo.com/4babe81a5d374516c4d7d86f80166b98

What I mean by percentage loaded is instead of the "[0/351]" it would show 0% or whatever percentage it is. Also why does it stay at 0/351 then skip to like 100/351? Is this to do with lag?

0
local percent = (5/10)*100 -- just change the numbers 5 and 10, then to write the percent do (percent.."%"). MythicalShade 420 — 5y
0
What do I change the 5 and 10 to? Parts and TotalParts? LawlR 182 — 5y
0
nvm LawlR 182 — 5y

1 answer

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

From the looks of it, that first "island" in the back isnt in the folder or whatever you are using to load the parts (i cant be sure because no script was provided).

AS for the percentage, you could look it up but here is a snippet ~

local percentage = "%"..(loadedBricks / totalBricks) * 10)
0
It's fine, It was loading a model with a large amount of parts, so it lagged the game. I ungrouped the model and it runs smoothly now. LawlR 182 — 5y
Ad

Answer this question