Sir_Spaceboi

lights script

Jul 26th, 2021
141
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.87 KB | None | 0 0
  1. local funcs = {}
  2.  
  3. function funcs.lasersOn()
  4.     local laserFolder = workspace:WaitForChild("LaserLights")
  5.    
  6.     local colors = {
  7.         191, 53, 236,
  8.         236, 202, 78,
  9.         23, 90, 236,
  10.         31, 122, 57,
  11.         122, 90, 37
  12.     }
  13.    
  14.     for Index, Light in ipairs(laserFolder:GetChildren()) do
  15.         local panMot = Light:FindFirstChild("LightingController").PanMotor
  16.         local tiltMot = Light:FindFirstChild("LightingController").TiltMotor
  17.        
  18.         if panMot and tiltMot then
  19.             local randomAngle1 = math.random(0 , 1)
  20.             local randomAngle2 = math.random(-1 , 0)
  21.            
  22.             panMot.DesiredAngle = randomAngle1
  23.             tiltMot.DesiredAngle = randomAngle2
  24.            
  25.             local lightBeam = Light:FindFirstChild("Body").Head.Beam1
  26.            
  27.             if lightBeam then
  28.                 local randomColor = Color3.new(math.random(0, #colors))
  29.                
  30.                 lightBeam.Transparency = 0
  31.                 lightBeam.Color = randomColor
  32.             end
  33.         end
  34.     end
  35. end
  36.  
  37. return funcs
Advertisement
Add Comment
Please, Sign In to add comment