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 » Scripters
Home Search
 

I'm trying to make get the transparency down in increments

Previous Thread :: Next Thread 
ComedicGesture is not online. ComedicGesture
Joined: 20 May 2011
Total Posts: 912
05 Jun 2016 11:10 AM
I know I can just type out script.Parent.Transparency = 0.9 then 0.8 and so on but I'm trying to find a better way to do that

This is my script so far but it's not working. I know that the problem is likely in line 3 but I don't have any idea how I would write it out otherwise.

function click()
for i = 1, 5 do
script.Parent.Transparency = script.Parent.Transparency-.1
wait(1)

end
script.Parent.ClickDetector.MouseClick:connect(click)
end
Report Abuse
HamilcarMago is not online. HamilcarMago
Joined: 11 Jul 2010
Total Posts: 1094
05 Jun 2016 11:11 AM
for i = 1,0,0.1 do
script.Parent.Transparency = script.Parent.Transparency - i
Report Abuse
Lord_Narwhal is not online. Lord_Narwhal
Joined: 05 May 2012
Total Posts: 3242
05 Jun 2016 11:11 AM
for i = 0,1.,.1 do
transparency = i
wait()
end


Report Abuse
HamilcarMago is not online. HamilcarMago
Joined: 11 Jul 2010
Total Posts: 1094
05 Jun 2016 11:11 AM
for i = 1,0,-0.1 do
script.Parent.Transparency = script.Parent.Transparency - i
end

-- Miss click, sorry
Report Abuse
Immersible is not online. Immersible
Joined: 14 Aug 2015
Total Posts: 432
05 Jun 2016 11:12 AM
function click()
for i = 0, 1, .2 do
script.Parent.Transparency = i
wait(1)
end
end
script.Parent.ClickDetector.MouseClick:connect(click)


Report Abuse
ComedicGesture is not online. ComedicGesture
Joined: 20 May 2011
Total Posts: 912
05 Jun 2016 11:27 AM
Thanks everyone for the help
Report Abuse
ComedicGesture is not online. ComedicGesture
Joined: 20 May 2011
Total Posts: 912
05 Jun 2016 11:29 AM
Just to check. By saying i = 0,1,.2 am I saying i is equal to every number between 0 and 1 that is divisible by .2?
Report Abuse
Lord_Narwhal is not online. Lord_Narwhal
Joined: 05 May 2012
Total Posts: 3242
05 Jun 2016 11:36 AM
it's a loop

i, the variable, will go from 0 to 1 by an increment of 0.2


Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • 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