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 doesn't this work?

Previous Thread :: Next Thread 
mage11561 is not online. mage11561
Joined: 03 Sep 2008
Total Posts: 13217
12 Aug 2011 04:25 PM
a = script.Parent
function onClicked()
a.Transparency = a.Transparency + 0.2
end
if a.Transparency >= 1 then
a:remove()
end
script.Parent.ClickDetector.MouseClick:connect(onClicked)


I'm making a brick that when you click it, its transparency increases, and I want the brick to be removed when the transparency is greater than/equal to 1, but the brick isn't being removed, BUT the transparency is being increased each time I click the brick. What's the problem here?
Thanks in advance :)
Report Abuse
BunnyBoy26 is not online. BunnyBoy26
Joined: 17 Jun 2010
Total Posts: 5674
12 Aug 2011 04:29 PM
a = script.Parent
function onClicked()
a.Transparency = a.Transparency + 0.2
if a.Transparency >= 1 then
a:remove()
end
end
script.Parent.ClickDetector.MouseClick:connect(onClicked)

Report Abuse
mage11561 is not online. mage11561
Joined: 03 Sep 2008
Total Posts: 13217
12 Aug 2011 04:32 PM
Ok, thanks :D
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