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: Why isn't this repeat loop working?

Previous Thread :: Next Thread 
E3x3 is not online. E3x3
Joined: 11 Nov 2013
Total Posts: 2137
07 Oct 2014 12:55 AM
repeat
game.Workspace.Part2.Transparency = game.Workspace.Part2.Transparency + .1
wait(.5)
until
game.Workspace.Part2.Transparency == 1


Part2's transparency will keep going up in instead of stopping on 1 and will not move on to the next line of code.
Report Abuse
128GB is not online. 128GB
Joined: 17 Apr 2014
Total Posts: 8056
07 Oct 2014 01:03 AM
repeat
workspace.Part2.Transparency = workspace.Part2.Transparency + .1
wait(0.5)
until workspace.Part2.Transparency >= 1
print("hi")



Float valuesssss
Report Abuse
E3x3 is not online. E3x3
Joined: 11 Nov 2013
Total Posts: 2137
07 Oct 2014 01:04 AM
Now why would that work opposed to the "=="
Sorry if it's a basic question.
Report Abuse
128GB is not online. 128GB
Joined: 17 Apr 2014
Total Posts: 8056
07 Oct 2014 01:11 AM
Something weird
I don't completely understand float values or whatever
Basically the number is actually 1.0000000000000000000002 or something along the lines of that and the property viewer shortens it to 1

So the number is not 1, its slightlyyyy above 1
Report Abuse
128GB is not online. 128GB
Joined: 17 Apr 2014
Total Posts: 8056
07 Oct 2014 01:14 AM
> workspace.BasePlate.Transparency = workspace.BasePlate.Transparency + 0.1
> workspace.BasePlate.Transparency = workspace.BasePlate.Transparency + 0.1
> workspace.BasePlate.Transparency = workspace.BasePlate.Transparency + 0.1
> workspace.BasePlate.Transparency = workspace.BasePlate.Transparency + 0.1
> workspace.BasePlate.Transparency = workspace.BasePlate.Transparency + 0.1
> workspace.BasePlate.Transparency = workspace.BasePlate.Transparency + 0.1
> workspace.BasePlate.Transparency = workspace.BasePlate.Transparency + 0.1
> workspace.BasePlate.Transparency = workspace.BasePlate.Transparency + 0.1
> workspace.BasePlate.Transparency = workspace.BasePlate.Transparency + 0.1
> workspace.BasePlate.Transparency = workspace.BasePlate.Transparency + 0.1
> print(workspace.Base.Transparency == 1)
> print(workspace.BasePlate.Transparency == 1)
false
> print(workspace.BasePlate.Transparency)
1.0000001192093



I started the baseplate at 0, and ran these from my command bar
Report Abuse
E3x3 is not online. E3x3
Joined: 11 Nov 2013
Total Posts: 2137
07 Oct 2014 11:36 PM
thanks :)
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