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: A CALL TO ARMS: Lighting

Previous Thread :: Next Thread 
Catstorm is not online. Catstorm
Joined: 26 Jun 2007
Total Posts: 11015
31 May 2012 07:31 PM
I am attempting to create a brick which, when touched, will change all the color/brightness settings of the level (in order to create different atmospheres for different areas.)

I'm pretty sure this script is wrong in some way or form. It prints nothing and does nothing.

function onTouched(hit)
print("PCHOOOO")
local human = hit.Parent:findFirstChild("Humanoid")
if (human ~= nil ) then
Game.Lighting.Ambient = Color3.new(128,0,0)
Game.Lighting.ColorShift_Bottom = Color3.new(128,0,0)
Game.Lighting.ColorShift_Top = Color3.new(204,0,0)
Game.Lighting.ShadowColor = Color3.new(0,0,0)
Game.Lighting.Brightness = 0.5
wait(1)
end
end


Additional Questions:

-Is _ allowed in this?

-Am I using the correct terminology for Colorshift and ShadowColor?

All help is appreciated very much. The saturated ambience is getting to my eyes.
Report Abuse
Catstorm is not online. Catstorm
Joined: 26 Jun 2007
Total Posts: 11015
31 May 2012 07:32 PM
(The indents begin at print("PCHOOOOO") and end at the first end.)
Report Abuse
Catstorm is not online. Catstorm
Joined: 26 Jun 2007
Total Posts: 11015
31 May 2012 07:41 PM
EDIT: Forgot the Script:Parent:connect (OnTouched) (or whatever) line at the bottom. Still doesn't work.
Report Abuse
SCARFACIAL is not online. SCARFACIAL
Joined: 28 Jan 2010
Total Posts: 7970
31 May 2012 07:42 PM
The function looks like it should work.
So since I didn't see one, I'm just going to assume all you need to do is add a connection line :P

script.Parent.Touched:connet(onTouched)

Haters gonn' hate.
Report Abuse
SCARFACIAL is not online. SCARFACIAL
Joined: 28 Jan 2010
Total Posts: 7970
31 May 2012 07:42 PM
Latepost :l

Haters gonn' hate.
Report Abuse
SCARFACIAL is not online. SCARFACIAL
Joined: 28 Jan 2010
Total Posts: 7970
31 May 2012 07:44 PM
Also, just so you know there's a 'max' color of 1,1,1 when using a Color3. To get exact colors like you're trying, just divide it by 255.

Game.Lighting.Ambient = Color3.new(128/255,0,0)
Game.Lighting.ColorShift_Bottom = Color3.new(128/255,0,0)
Game.Lighting.ColorShift_Top = Color3.new(204/255,0,0)

Haters gonn' hate.
Report Abuse
brandon58590 is not online. brandon58590
Joined: 08 Mar 2008
Total Posts: 996
31 May 2012 08:16 PM
script.Parent.Touched:connect(function()
print("PCHOOOO")
local human = hit.Parent:findFirstChild("Humanoid")
if human ~= nil then
game.Lighting.Ambient = Color3.new(128,0,0)
game.Lighting.ColorShift_Bottom = Color3.new(128,0,0)
game.Lighting.ColorShift_Top = Color3.new(204,0,0)
game.Lighting.ShadowColor = Color3.new(0,0,0)
game.Lighting.Brightness = 0.5
end

Does this work? If it doesn't some output may be useful.
Report Abuse
brandon58590 is not online. brandon58590
Joined: 08 Mar 2008
Total Posts: 996
31 May 2012 08:17 PM
Oh I forgot a ")" after "end". Don't forget that!
Report Abuse
Catstorm is not online. Catstorm
Joined: 26 Jun 2007
Total Posts: 11015
31 May 2012 08:28 PM
I will test this tomorrow and get back to both of your suggestions. Homework is nigh. Thanks.
Report Abuse
Catstorm is not online. Catstorm
Joined: 26 Jun 2007
Total Posts: 11015
01 Jun 2012 06:30 PM
Neither adjustment worked :(
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