Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

Help with Lighting Script?

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

✓ Accepted answer

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

This discussion is preserved as it was. New answers, comments, and votes are closed.