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: in need of support

Previous Thread :: Next Thread 
incrazed is not online. 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 is not online. 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
lampwnage121 is not online. lampwnage121
Joined: 20 Oct 2012
Total Posts: 4285
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
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