|
| 22 Aug 2012 05:20 PM |
for i = 0, 100 do script.Parent.Frame.Size = UDim2.new(0, math.ceil(i), 0, 50) wait(math.random(1)) end
math.ceil is supposed to round up, but it doesn't seem to be working. I wouldn't have to be using it if the for loop didn't give me whole numbers... Help?
† KMXD †
|
|
|
| Report Abuse |
|
|
|
| 22 Aug 2012 05:23 PM |
for i = 0, 100, .5 do script.Parent.Frame.Size = UDim2.new(0, math.ceil(i), 0, 50) wait(math.random(1)) end
Θ_Θ Sage Mode! |
|
|
| Report Abuse |
|
|
|
| 22 Aug 2012 05:28 PM |
Do you want it to round up, or to the nearest integer? |
|
|
| Report Abuse |
|
|
|
| 22 Aug 2012 05:31 PM |
No dice, Des.
@Dark
It doesn't matter, nearest integer, rounds up, rounds down, as long as it's close and not a decimal...
† KMXD † |
|
|
| Report Abuse |
|
|
|
| 22 Aug 2012 05:32 PM |
| The "i" is already a whole number. |
|
|
| Report Abuse |
|
|
|
| 22 Aug 2012 05:35 PM |
It's supposed to be, but it's not giving me whole numbers.
† KMXD † |
|
|
| Report Abuse |
|
|
|
| 22 Aug 2012 05:37 PM |
for i = 0, 200, 2 do script.Parent.Frame.Size = UDim2.new(0, math.ceil(i), 0, 50) wait(math.random(1)) end
Maybe that'll fix??
Θ_Θ Sage Mode! |
|
|
| Report Abuse |
|
|
| |
|
|
| 22 Aug 2012 05:44 PM |
for i = 0, 100 do script.Parent.Frame.Size = UDim2.new(0, math.ceil(i), 0, 50) print(script.Parent.Frame.Size) wait(math.random(1)) end
Run this, give us the output. |
|
|
| Report Abuse |
|
|
|
| 22 Aug 2012 05:46 PM |
Remove the math.ceil? Its working for me fine:
local f = Instance.new("Frame")
for i = 0, 100 do f.Size = UDim2.new(0, i, 0, 50) print(f.Size.X.Offset) end
f = f:Destroy()
Command Bar - local f = Instance.new("Frame") for i = 0, 100 do f.Size = UDim2.new(0, i, 0, 50) print(f.Size.X.Offset) end f = f:Destroy() |
|
|
| Report Abuse |
|
|
|
| 22 Aug 2012 05:49 PM |
@Destro;
Funny sig ^.^
@awesum;
Unlike CFrames and vectors calling print on a UDim class would just return a userdata |
|
|
| Report Abuse |
|
|
|
| 22 Aug 2012 05:51 PM |
I'm naruto fan :P, new episode is out today, time to watch :D
Θ_Θ Sage Mode! |
|
|
| Report Abuse |
|
|
|
| 22 Aug 2012 05:52 PM |
@aw
userdata: 179EB070 userdata: 17BDF5E0 userdata: 17BDFA30 userdata: 17BDFC70 ... And so forth.
@Styg
1 2 3 4 5 ...
But it still shows decimals in the text.
† KMXD † |
|
|
| Report Abuse |
|
|
|
| 22 Aug 2012 06:00 PM |
@Knight What text?
@Destro Me too :P I'm just sad we have to wait a full week for a new episode, especially now that the war is getting exciting |
|
|
| Report Abuse |
|
|
|
| 22 Aug 2012 06:01 PM |
I can never keep up with the episodes, I have the newest game at least :P
But ANYWAYS. I found the problem. I accidentally posted the wrong script, and now I just have to use math.ceil on another part. Thanks for the help, all!
† KMXD † |
|
|
| Report Abuse |
|
|
|
| 22 Aug 2012 06:03 PM |
Yup, works perfectly now. Thanks again, guys.
† KMXD † |
|
|
| Report Abuse |
|
|