roy1010
|
  |
| Joined: 12 Nov 2008 |
| Total Posts: 136 |
|
|
| 29 Jun 2017 12:20 AM |
| Is there a way to change all the bricks pointlights in a model with a script? If so how would I go about doing that? Thanks in advance |
|
|
| Report Abuse |
|
|
|
| 29 Jun 2017 12:30 AM |
| You could have a variable that connects all the pointlights but then you have to manually change it each. Like this (not a good script or anything) local Pointlight1 = ###################################### local Poointlight2 = ###################################### If "something touchedevent,mouseclick, or something" then Pointlight1.Enabled = true Pointlight2.Enabled = true |
|
|
| Report Abuse |
|
|
|
| 29 Jun 2017 12:31 AM |
hashtags are game . workspace . model . part . partlight
|
|
|
| Report Abuse |
|
|
1pie23
|
  |
| Joined: 11 Jul 2010 |
| Total Posts: 1865 |
|
|
| 29 Jun 2017 12:35 AM |
put this in the model
for k,v in pairs(script.Parent:GetChildren()) do
if v:FindFirstChild("PointLight") then --are all named PointLight?
v.PointLight.Range = 20 -- change property here
end
end |
|
|
| Report Abuse |
|
|
roy1010
|
  |
| Joined: 12 Nov 2008 |
| Total Posts: 136 |
|
|
| 29 Jun 2017 12:36 AM |
| After I acces the bricks through the script, what would be the code that would go into changing the colors of the pointlights to lets say blue and then it changing to red after 1 second? |
|
|
| Report Abuse |
|
|
1pie23
|
  |
| Joined: 11 Jul 2010 |
| Total Posts: 1865 |
|
|
| 29 Jun 2017 12:38 AM |
| for k,v in pairs(script.Parent:GetChildren()) do if v:FindFirstChild("PointLight") then --are all named PointLight? v.PointLight.Color = ########################### -- This makes it white, make the light the color you want then copy and paste the numbers that correspond in the properties. end end |
|
|
| Report Abuse |
|
|
1pie23
|
  |
| Joined: 11 Jul 2010 |
| Total Posts: 1865 |
|
|
| 29 Jun 2017 12:39 AM |
| #####'s are ########################### |
|
|
| Report Abuse |
|
|