generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripting Helpers
Home Search
 

Re: Whats wrong with this?

Previous Thread :: Next Thread 
cosmonova1 is not online. cosmonova1
Joined: 17 Apr 2009
Total Posts: 14624
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
ElectricAxel is not online. ElectricAxel
Joined: 15 May 2009
Total Posts: 16239
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 is not online. 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 is not online. 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
cosmonova1 is not online. cosmonova1
Joined: 17 Apr 2009
Total Posts: 14624
24 Jun 2012 06:07 PM
how exactally would i do so?
Report Abuse
MrNicNac is not online. 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
ElectricAxel is not online. ElectricAxel
Joined: 15 May 2009
Total Posts: 16239
24 Jun 2012 06:14 PM
adark, there is a minimum wait, it can't go below 1/30...
Report Abuse
adark is not online. 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 is not online. 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
ElectricAxel is not online. ElectricAxel
Joined: 15 May 2009
Total Posts: 16239
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 is not online. 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
ElectricAxel is not online. ElectricAxel
Joined: 15 May 2009
Total Posts: 16239
24 Jun 2012 06:39 PM
Your way of thinking is amazing. xD I will stop responding now. :P
Report Abuse
adark is not online. 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 is not online. 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
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripting Helpers
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image