|
| 23 Jun 2016 07:18 PM |
CODE;
repeat wait()lui.Bar:TweenSize(UDim2.new((cp.RequestQueueSize/cpl),0,0,20),"InOut","Quad",.1)until cp.RequestQueueSize<1
So what I'm trying to do is make the bar go up all the way till the end, but it keeps spazing out. Can someone tell me off how big of an idiot I am and how could I fix this?
|
|
|
| Report Abuse |
|
|
| |
|
|
| 23 Jun 2016 07:19 PM |
oh cpl is this, this is used to make an actual queue for the place;
local cpl=cp.RequestQueueSize
|
|
|
| Report Abuse |
|
|
|
| 23 Jun 2016 07:20 PM |
So basically it seeks to find how much the assets are pending at the start of the game.
|
|
|
| Report Abuse |
|
|
Borsy
|
  |
| Joined: 31 Jul 2014 |
| Total Posts: 15111 |
|
|
| 23 Jun 2016 07:21 PM |
h='' repeat while true do Spawn(function() while true do print'help' h=h..'a' end end) end until false
|
|
|
| Report Abuse |
|
|
|
| 23 Jun 2016 07:22 PM |
the queue size might have increased after you set cpl to the current queue size
also, you should set the override argument of the tween to true, like this, so that the newest tween is always the one thats active:
TweenSize(size, "InOut", "Quad", .1, true) |
|
|
| Report Abuse |
|
|
|
| 23 Jun 2016 07:24 PM |
So is there a way I could make it so if it increased, it will lower the bar instead of going over it?
|
|
|
| Report Abuse |
|
|
|
| 23 Jun 2016 07:25 PM |
yeah, something like:
local cpl = cp.RequestQueueSize repeat wait() if cp.RequestQueueSize > cpl then cpl = cp.RequestQueueSize end lui.Bar:TweenSize(UDim2.new((cp.RequestQueueSize/cpl),0,0,20),"InOut","Quad",.1) until cp.RequestQueueSize < 1 |
|
|
| Report Abuse |
|
|
|
| 23 Jun 2016 07:34 PM |
| Is it intentional for cp.RequestQueueSize/cpl to be one on the first iteration then decrease to zero? |
|
|
| Report Abuse |
|
|
War_Force
|
  |
| Joined: 15 Apr 2016 |
| Total Posts: 2611 |
|
|
| 23 Jun 2016 07:37 PM |
The lower the number is, the higher the bar goes, that's my intention. This is my main btw.
|
|
|
| Report Abuse |
|
|
War_Force
|
  |
| Joined: 15 Apr 2016 |
| Total Posts: 2611 |
|
|
| 23 Jun 2016 07:38 PM |
Basically I'm trying to do like something at plaza, where it shows loading asset screen.
|
|
|
| Report Abuse |
|
|
|
| 23 Jun 2016 07:42 PM |
Then modifying the above code, it should be:
local cpl = cp.RequestQueueSize repeat wait() if cp.RequestQueueSize > cpl then cpl = cp.RequestQueueSize end lui.Bar:TweenSize(UDim2.new((1 - cp.RequestQueueSize/cpl),0,0,20),"InOut","Quad",.1) until cp.RequestQueueSize < 1
|
|
|
| Report Abuse |
|
|
War_Force
|
  |
| Joined: 15 Apr 2016 |
| Total Posts: 2611 |
|
|
| 23 Jun 2016 07:43 PM |
Gray, you're a god. Thanks!
|
|
|
| Report Abuse |
|
|