incrazed
|
  |
| Joined: 28 Feb 2010 |
| Total Posts: 340 |
|
|
| 01 Aug 2013 11:03 PM |
i am creating a script that all the Dynamic PointLight to change color from red to green, with a click or something said. so far i got nothing, i have 26 Lights and i don't want to create lots of line of code. someone gave me the idea to use For Loops, but i dont know that either. i just know the mere basic scripting.
--what i set up so far local game = game.Workspace local red = PointLight.Color.new = color3(200, 0, 3) local blue = PointLight.Color.new = color3(14, 98, 200)
|
|
|
| Report Abuse |
|
|
incrazed
|
  |
| Joined: 28 Feb 2010 |
| Total Posts: 340 |
|
|
| 01 Aug 2013 11:10 PM |
would this work?
local game = game.Workspace local red = PointLight.Color.new local blue = PointLight.Color.new
local stuff = game.Workspace:GetChildren() while true do for i = 1,#stuff do if stuff[i].Name =="Light" then game.Light.red = color3(200, 0, 3) wait() game.Light.blue = color3(14, 98, 200) end end end
|
|
|
| Report Abuse |
|
|
|
| 02 Aug 2013 07:18 AM |
You can`t create a variable named "game"
local stuff = game.Workspace:GetChildren() for i = 1, #stuff do if stuff[i].Name =="Light" then stuff[i].PointLight.Color = Color3.new(200, 0, 3) wait(1) stuff[i].Light.PointLight.Color = Color3.new(14, 98, 200) end end |
|
|
| Report Abuse |
|
|