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
 

Help

Previous Thread :: Next Thread 
ColinRocks99 is not online. ColinRocks99
Joined: 04 May 2013
Total Posts: 1533
03 Nov 2016 03:41 PM
I have a script that constantly checks for a value. If it is 3 it makes itself transparent, and if its 0 it makes itself visible. It's not functioning, so can someone fix it?

while true do

wait(1)

if game.Workspace["Current Color"].Value == 3 then

script.Parent.Transparency = 1
script.Parent.CanCollide = false


elseif game.Workspace["Current Color"].Value == 0 then

script.Parent.Transparency = 0
script.Parent.CanCollide = true

end
end
Report Abuse
SurKipper is not online. SurKipper
Joined: 25 Dec 2011
Total Posts: 435
03 Nov 2016 04:08 PM
any errors in the console?

in the top of the screen

View > Output

just in case
Report Abuse
yankana is not online. yankana
Joined: 17 Jun 2011
Total Posts: 431
03 Nov 2016 04:13 PM
Use the 'Changed'-event instead. It's more efficient.

game.Workspace["Current Color"].Changed:connect(function(value)
if value == 3 then
script.Parent.Transparency = 1
script.Parent.CanCollide = false
elseif value == 0 then
script.Parent.Transparency = 0
script.Parent.CanCollide = true
end
end
Report Abuse
yankana is not online. yankana
Joined: 17 Jun 2011
Total Posts: 431
03 Nov 2016 04:14 PM
^ Forgot the ) at the end. Console will tell you anyways.
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