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: Lighting Script

Previous Thread :: Next Thread 
Tlindsley is not online. Tlindsley
Joined: 11 Feb 2011
Total Posts: 59
06 Dec 2013 05:26 PM
If I want a script to make everything in workspace named "light" spotlight's range=40 How would that be coded? Example
game.workspace._____________.spotlight.range=40
Blank space = All the lights instead of numbering them. Just tell the script to make all Item's named "Light" spotlight rande= 40. Thanks
Report Abuse
DrRandomous is not online. DrRandomous
Joined: 25 Mar 2011
Total Posts: 1702
06 Dec 2013 05:34 PM
No. We wont 'ust tell the script to make all Item's named "Light" spotlight rande=40'


You have a go, we help.
Report Abuse
GGGGG14 is not online. GGGGG14
Joined: 29 Jan 2012
Total Posts: 25344
06 Dec 2013 05:35 PM
for _, lights in pairs(game.Workspace:GetChildren()) do
if lights.Name == "light" then
lights.SpotLight.Range = 40
end end
Report Abuse
Tlindsley is not online. Tlindsley
Joined: 11 Feb 2011
Total Posts: 59
06 Dec 2013 05:39 PM
^Thank You, but how would you make it do this OnClicked?
Report Abuse
Tlindsley is not online. Tlindsley
Joined: 11 Feb 2011
Total Posts: 59
06 Dec 2013 06:00 PM
As to have a button colored green turn the lights on, then a button colored red turn the lights off....
Report Abuse
SamuelKingx is not online. SamuelKingx
Joined: 27 Jan 2012
Total Posts: 3472
06 Dec 2013 06:03 PM
If you mean a TextButton..

script.Parent.MouseButton1Down:connect(function()
for _, lights in pairs(game.Workspace:GetChildren()) do
if lights.Name == "light" then
lights.SpotLight.Range = 40
end 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