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 |
|
|
|
| 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
|
  |
| 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
|
  |
| 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
|
  |
| 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 |
|
|
|
| 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 |
|
|