Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Help with Lighting Script?

Asked by 10 years ago

Hi,

I would like to know what the script would look like if I wanted to make a fading light script. I press a button which activates the script to make the lights fade.

What would the script look like?

Thanks Kieran

1 answer

Log in to vote
0
Answered by
dyler3 1510 Moderation Voter
10 years ago

Well first you would insert a clickdetector into the button, then insert a script like this into the clickdetector:

function Clicked()
a={game.Workspace.Part.Light1,game.Workspace.Part.Light2}--Change these to where the lights actually are.
for i=s,0,-.2 do--change o to what the brightness of the lights are.
wait(.1)
a{1}.Brightness=i
a[2].Brightness=i --If there's more lights then add a[3].Brightness=i, a[4].Brightness=i, etc.
end
end

script.Parent.MouseClick:connect(Clicked)--This connects 'Clicked'.
Ad

Answer this question