|
| 24 Jun 2012 06:00 PM |
im trying to make the frame grow like a loading bar but idk whats wrong...
while true do x = script.Parent.Size wait(0.001) x = x + (0.0005,0,0,0) end
|
|
|
| Report Abuse |
|
|
|
| 24 Jun 2012 06:05 PM |
while true do script.Parent.Size = script.Parent.Size + UDim2.new(0.0005, 0, 0, 0) wait() end |
|
|
| Report Abuse |
|
|
adark
|
  |
| Joined: 13 Jan 2008 |
| Total Posts: 6412 |
|
|
| 24 Jun 2012 06:05 PM |
1) You're wait is WAAAY too small. You're trying to do 1000 operations every second. 2) Don't put this into a while..do loop. Use a for loop, so that it terminates when the bar is "full" 3) You need to use UDim2.new(), not just parentheses. |
|
|
| Report Abuse |
|
|
adark
|
  |
| Joined: 13 Jan 2008 |
| Total Posts: 6412 |
|
|
| 24 Jun 2012 06:07 PM |
Also,
x = script.Parent.Size
just copies the value of Size to x
x = script.Parent x.Size
actually references script.Parent.Size. |
|
|
| Report Abuse |
|
|
|
| 24 Jun 2012 06:07 PM |
| how exactally would i do so? |
|
|
| Report Abuse |
|
|
MrNicNac
|
  |
| Joined: 29 Aug 2008 |
| Total Posts: 26567 |
|
|
| 24 Jun 2012 06:09 PM |
Just find the end size you want it and it will grow smoothly.
local endSize = UDim2.new(.5,0,.3,0) script.Parent:TweenSize(endSize) |
|
|
| Report Abuse |
|
|
|
| 24 Jun 2012 06:14 PM |
| adark, there is a minimum wait, it can't go below 1/30... |
|
|
| Report Abuse |
|
|
adark
|
  |
| Joined: 13 Jan 2008 |
| Total Posts: 6412 |
|
|
| 24 Jun 2012 06:23 PM |
"You're trying to do 1000 operations every second!" Keyword trying. I know that there is a bottom limit, you don't need to correct me on that.
|
|
|
| Report Abuse |
|
|
MrNicNac
|
  |
| Joined: 29 Aug 2008 |
| Total Posts: 26567 |
|
|
| 24 Jun 2012 06:24 PM |
"you don't need to correct me on that."
oooooo |
|
|
| Report Abuse |
|
|
|
| 24 Jun 2012 06:33 PM |
lol MNN
Then why did you even say the wait is too small? Without saying it doesn't matter if its below 1/30? ._. |
|
|
| Report Abuse |
|
|
adark
|
  |
| Joined: 13 Jan 2008 |
| Total Posts: 6412 |
|
|
| 24 Jun 2012 06:36 PM |
Because, that limit isn't present everywhere. If you tried to do something 1000 times every second, you'd break your computer.
Besides, updating 30 times a second is still excessive. |
|
|
| Report Abuse |
|
|
|
| 24 Jun 2012 06:39 PM |
| Your way of thinking is amazing. xD I will stop responding now. :P |
|
|
| Report Abuse |
|
|
adark
|
  |
| Joined: 13 Jan 2008 |
| Total Posts: 6412 |
|
|
| 24 Jun 2012 06:41 PM |
| I'll take that as a compliment, then. :P |
|
|
| Report Abuse |
|
|
MrNicNac
|
  |
| Joined: 29 Aug 2008 |
| Total Posts: 26567 |
|
|
| 24 Jun 2012 06:42 PM |
"Your way of thinking is amazing. xD I will stop responding now. :P"
And we begin to smile.
:) |
|
|
| Report Abuse |
|
|