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
|
  |
| 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
|
  |
| 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 |
|
|
|
| 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 |
|
|
|
| 31 May 2012 07:42 PM |
Latepost :l
Haters gonn' hate. |
|
|
| Report Abuse |
|
|
|
| 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 |
|
|
|
| 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 |
|
|
|
| 31 May 2012 08:17 PM |
| Oh I forgot a ")" after "end". Don't forget that! |
|
|
| Report Abuse |
|
|
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
|
  |
| Joined: 26 Jun 2007 |
| Total Posts: 11015 |
|
|
| 01 Jun 2012 06:30 PM |
| Neither adjustment worked :( |
|
|
| Report Abuse |
|
|