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
 

Small Transparency Script Help

Previous Thread :: Next Thread 
BaconSoap is not online. BaconSoap
Joined: 12 Sep 2010
Total Posts: 1882
10 Apr 2013 10:17 AM
I'm trying to make a log become transparent when clicked, and if its already transparent, turn it back to 0 transparency.

Why does this work:

local loggy = game.Workspace.Log

function clickLoggy(playerWhoClicked)
if loggy.Transparency == 0
then loggy.Transparency = 1
else
loggy.Transparency = 0
end
end
script.Parent.ClickDetector.MouseClick:connect(clickLoggy)

And this doesn't:

local loggy = game.Workspace.Log

function clickLoggy(playerWhoClicked)
if loggy.Transparency == 0
then loggy.Transparency = 0.5
else
loggy.Transparency = 0
end
end
script.Parent.ClickDetector.MouseClick:connect(clickLoggy)

It's merely a change in the transparency value, why does it no longer work with this change?
Report Abuse
getkoed2 is not online. getkoed2
Joined: 11 Apr 2010
Total Posts: 1144
10 Apr 2013 10:20 AM
Idk, but please put 'then' on the same line as 'if' and you don't need playerWhoClicked.
Report Abuse
BaconSoap is not online. BaconSoap
Joined: 12 Sep 2010
Total Posts: 1882
10 Apr 2013 10:22 AM
Gee, thanks for the help. :L
Report Abuse
getkoed2 is not online. getkoed2
Joined: 11 Apr 2010
Total Posts: 1144
10 Apr 2013 10:25 AM
Are there decals on it?
Report Abuse
BaconSoap is not online. BaconSoap
Joined: 12 Sep 2010
Total Posts: 1882
10 Apr 2013 10:25 AM
No.
Report Abuse
BaconSoap is not online. BaconSoap
Joined: 12 Sep 2010
Total Posts: 1882
10 Apr 2013 11:18 AM
Bumper Cars.
Report Abuse
Prehistoricman is not online. Prehistoricman
Joined: 20 Sep 2008
Total Posts: 12490
10 Apr 2013 11:23 AM
Print the transparency at the start of your function. What does the output say?
Report Abuse
BaconSoap is not online. BaconSoap
Joined: 12 Sep 2010
Total Posts: 1882
10 Apr 2013 11:25 AM
How would I do that? ._.
Report Abuse
btft is not online. btft
Joined: 19 Feb 2011
Total Posts: 1512
10 Apr 2013 11:27 AM
function clickLoggy(playerWhoClicked)
if loggy.Transparency == 0
then loggy.Transparency = 0.5
else
loggy.Transparency = 0
end
end
script.Parent.ClickDetector.MouseClick:connect(playerWhoClicked)
Report Abuse
blockold is not online. blockold
Joined: 25 Aug 2008
Total Posts: 1411
10 Apr 2013 11:30 AM
To print it out? Do this: Also, I fixed up the if-then line ;3

local loggy = game.Workspace.Log

print(loggy.Transparency)

function clickLoggy(playerWhoClicked)
if loggy.Transparency == 0 then
loggy.Transparency = 1
else
loggy.Transparency = 0
end
end
script.Parent.ClickDetector.MouseClick:connect(clickLoggy)

print(loggy.Transparency)

All that does is patch up the if-then statement and prints the transparency to the Output. To view the output, go into View - Output. It SHOULD work.
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