I am making spotlights and plan to add flashing beams like spotlight, I have no idea how to script properties of beams at all, thankyou.
This site is not a request site. If you make something, we correct it, but not make you the full script. Please watch tutorial videos first, or maybe search it on google, because I won't answer your further requests.
To make a light flash, you have to disable then re-enable it. Put this script inside the part where the SpotLight is:
local time1 = 1 --This is how long you have to wait in seconds for the light to turn off again local time2 = 1 --This is how long you have to wait in seconds for the light to turn back on local light = script.Parent.SpotLight --Change this to your needs while wait(time1) do light.Enabled = false --Turns light off wait(time2) light.Enabled = true --Turns light on end
To make a light fade you have to slowly turn its brightness off or on. You can use the Tween Service (smoother) or a loop (easier) for that:
Loop:
local brightness = 1 --The original brightness value, usually 1 local light = script.Parent.SpotLight --Fading out: repeat wait(0.1) --How fast the fading is light.Brightness = light.Brightness - 0.01 until light.Brightness == 0 --Fading in: repeat wait(0.1) --How fast the fading is light.Brightness = light.Brightness + 0.01 until light.Brightness == brightness
TweenService:
local brightness = 1 local light = script.Parent.SpotLight local goal = {} local TW = game.TweenService local tweenInfo = TweenInfo.new(1) --How fast the fading is in seconds --Fading out: goal.Brightness = 0 local tween = TW:Create(light, tweenInfo, goal) tween:Play() --Fading in: goal.Brightness = brightness local tween = TW:Create(light, tweenInfo, goal) tween:Play()
Sorry for my English and let me know if I helped
https://gyazo.com/e25b12d440423e9ebcaf285e5d0bacd3- I was on about the Beam but like using light is really helpful too.