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: Col3 values

Previous Thread :: Next Thread 
edenojack is not online. edenojack
Joined: 18 Jul 2008
Total Posts: 989
04 Apr 2013 05:29 PM
I am using these lines of code;

function ch()
if game.Lighting.FogEnd ~= script.Parent.FogDist.Value or game.Lighting.FogColor ~= script.Parent.FogCol.Value then
game.Lighting.FogEnd = script.Parent.FogDist.Value
game.Lighting.FogColor = Color3.new(script.Parent.FogCol.Value)
end
end

game.Lighting.Changed:connect(ch);

script.Parent.FogDist.Changed:connect(function() game.Lighting.FogEnd = script.Parent.FogDist.Value;
game.Lighting.FogColor = Color3.new(script.Parent.FogCol.Value); end)

script.Parent.FogCol.Changed:connect(function() game.Lighting.FogEnd = script.Parent.FogDist.Value;
game.Lighting.FogColor = Color3.new(script.Parent.FogCol.Value); end)


The script changes the lighting of the game depending on values in the players hopperbin. The final function is not picked up however, and thus the games fog colour never changes.

Throughout the script, the FogColor never changes in game, and I am unsure as to why. Any help?
Report Abuse
edenojack is not online. edenojack
Joined: 18 Jul 2008
Total Posts: 989
05 Apr 2013 04:43 PM
Mini-Bump :P Any help?
Report Abuse
lordsheen is not online. lordsheen
Joined: 24 Oct 2008
Total Posts: 608
05 Apr 2013 04:48 PM
game.Lighting.Changed:connect(function()
if game.Lighting.FogEnd ~= script.Parent.FogDist.Value or game.Lighting.FogColor ~= script.Parent.FogCol.Value then
game.Lighting.FogEnd = script.Parent.FogDist.Value
game.Lighting.FogColor = Color3.new(script.Parent.FogCol.Value)
end
end

end)
Report Abuse
edenojack is not online. edenojack
Joined: 18 Jul 2008
Total Posts: 989
05 Apr 2013 05:18 PM
While it works, I have realised the error.

The Color3Vals are all coming out wrong.
The line;

script.Parent.FogCol.Value = Color3.new(0, 37, 57)

Actually makes the FogCol value come out as (45700, 0, 0)

Is there any way I can fix this?
Report Abuse
Desperian is not online. Desperian
Joined: 07 Feb 2012
Total Posts: 3371
05 Apr 2013 06:01 PM
"Color3 values only range from 0 to 1. Many people prefer to use a system with a range of 255 instead of a range of one. Here is a useful piece of code:"

You need to divide each number by 255.
Report Abuse
edenojack is not online. edenojack
Joined: 18 Jul 2008
Total Posts: 989
05 Apr 2013 06:07 PM
ah... many thanks :)
Report Abuse
edenojack is not online. edenojack
Joined: 18 Jul 2008
Total Posts: 989
05 Apr 2013 06:14 PM
Now the values come out as 0 :/
Report Abuse
Desperian is not online. Desperian
Joined: 07 Feb 2012
Total Posts: 3371
05 Apr 2013 06:57 PM
Are you sure you're doing...

script.Parent.FogCol.Value = Color3.new(0, 37/255, 57/255)

Report Abuse
edenojack is not online. edenojack
Joined: 18 Jul 2008
Total Posts: 989
06 Apr 2013 07:23 AM
That's the line I'm using. However it is still all black :(
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