User's Dynamic Lighting

Ever wanted to make lighting specific to one area? Want to make the blur set to 10 in one area, but 5 in a different area?

Well, I got the module for you!
I have made a module that allows you to set lighting to be specific to a certain area in workspace.

How to use it? Simple.

  • First, create a container, i.e. a folder, and add parts to the container. (This can be any name you want!)
    The part’s name will define which area to use. You can size it and rotate it however you want!
  • Then, run the init function with the parameters (container)! The container argument should be the container you just created.
  • Lastly, go into a script, and run createArea with the parameters (name, instances)! The second argument should be a table containing all the instances you wish for the area to use for lighting.
  • If you want to update an area with new effects, use the updateArea function. WARNING: This ADDS to the area, not reset it with the new effects.
  • And, if you want to delete an area, use the deleteArea function.
  • If you want to set a default area, use the setDefaultLighting function with params (instances). The first argument should be a table of all the default lighting instances.

What if you want to stop the script? Well, then you need to use the kill function. Warning though, once it is killed, you cannot restart it.

Possible errors

  • If a user is in two areas at once, it will flash inbetween the said areas.

Module Source
Example of usage (Open source)

7 Likes