# Any way to find "percentage of tween completed"?

yes u can know the time of the tween, for example if u know ur tween lasts 2 seconds, then u can easilly represent that on bar

It’s not simple math, is it? I don’t have any percentages in the math program this year, but you could use fractions and convert them into percentages. You can use the size as reference, so for example `local fraction = AktualSize/TotalSize` and just convert this to a percentage. You can google.

1 Like

Well no, since it represents the amount of time it takes for all assets to load in…

How would I get the fraction completed then?

why would u like to tween unload assets, I dont get it

So all the assets are preloaded into the game before the player joins

you can do something like this

``````--GUIObject:TweenPosition(BlaBla, EasingDirection, EasingStyle, Time)
local CurrentTime = tick()
local percentage

percentage = ((CurrentTime-tick()) / Time) * 100
``````

If you want it in decimal form simply remove the * 100

Just make sure you keep updating the percentage value with that formula so it’s up to speed

``````script.Parent:RemoveDefaultLoadingScreen()

local contenProvider = game:GetService("ContentProvider")
end

wait(1)
``````

Oh, yeah it is, my bad (30 chars)

Why not the GetPropertyChangedSignal function? So if the size stops to change it would stop the script.

Ye that works too
(30 Characters)

1 Like

Ok so this is giving me an error:
`local percent = tonumber(script.Parent.Loaded.Size.X) / 0.9 * 100`

EDIT: maybe because it’s a UDim2

the tonumber is useless (in that scenario), and yes it’s because its udim, you need to index the scale or offset value.

2 Likes

Ok. That works but how can I remove all the decimals places, so it’s only a whole number? Sorry, never done something like this haha

1 Like

you use the math.floor() function

1 Like

Thank you, works perfectly! @InternallyAmplified @Eternalove_fan32

2 Likes