BoxLight - Change lighting easily in selected areas!

BoxLight - Change lighting easily in selected areas!

I made this simple module that lets you have areas (parts) with different lighting on the client.

Methods

local module = -- YOUR MODULE LOCATION!

module.new() -- Create a new lightingBox.

module:updateDefaultLighting() -- Updates the default lighting defined in the module.

lightingBox:setFadeTime(number) -- Set how long it takes to fade between changing lighting for this box only.

lightingBox:startListening() -- Starts listening for camera entering or exiting the box.

lightingBox:stopListening() -- Stops what :startListening() does.

lightingBox:setLighting() -- Expects dictionary with the properties that need to change. (Having missing values wont change them in Lighting)

Example (LocalScript in StarterGui)

local boxLight = -- MODULE LOCATION
local lightingBox = boxLight.new(workspace:WaitForChild("Part"))

lightingBox:setLighting({
	["Ambient"] = Color3.new(1, 0, 0);
	["OutdoorAmbient"] = Color3.new(1, 0, 0);
})

lightingBox:setFadeTime(0.5)

lightingBox:startListening()

Result

0331

Please tell me if you found bugs, or if i am missing features that i should add!
This is my first actual public module, so keep that in mind before sending criticism.

Get BoxLight

3 Likes

This is a great module, Iā€™m very excited to see what I can do with this!


Also please update this link to https://create.roblox.com/store/asset/126364728447912/BoxLight-Module, the current link directs to this configure page of the module.

Just noticed that, thanks!

This text will be blurred