Using module script contents to change in-game settings?

I have a plugin (Movie Lighting Plugin), and it gives the option to convert the lighting settings to a module script, and with this I plan to make it so when a proximity prompt is triggered it will change the lighting settings to the settings inside of the module script.
I imagine this will go through by when the proximityprompt from a serverscript is fired it will go to a RemoteEvent, then changing the person who triggered it has their lighting changed.

Here is what I have, not sure how to implement this?

return {
	--// Created with "Movie Lighting" version 1.31
	['LightingSettings'] = {
		['Ambient'] = Color3.fromRGB(40,113,108),
		["Brightness"] = 3,
		["ColorShift_Bottom"] = Color3.fromRGB(244,255,139),
		["ColorShift_Top"] = Color3.fromRGB(45,121,41),
		['EnvironmentDiffuseScale'] = 1,
		["EnvironmentSpecularScale"] = 1,
		['GlobalShadows'] = false,
		["OutdoorAmbient"] = Color3.fromRGB(75,107,181),
		["ShadowSoftness"] = 0.20000000298023224,
		["FogEnd"] = 100000,
		["FogStart"] = 0,
		["FogColor"] = Color3.fromRGB(192,192,192),
		["ClockTime"] = 15,
		["GeographicLatitude"] = 0,
	['ContentBin'] = script.ContentBin,

if its on a settings panel:

  1. Take input on settings (Could be either booleans, string, or number values)
  2. Then create a function that edits the module after taking that input.
  3. Create another function that changes the lightning setting, with that input.


-- First I will go on the setting panel, change ClockTime to 10
-- On my regular script, I would detect that with FunctionA, and send that to FunctionB to edit modulescript

-- On FunctionB, I change the value on the Module script
-- I can either create a loop that constantly checks for updates on the module, then update
-- Or I can update the settings inside of FunctionB

That’s probably the furthest I can go without giving you a script.

I’m sorry, I’m a little confused. Do you mind giving a small script example ?

the reason I didn’t write a little script is because I don’t know how your plugin works or even how to script plugins (but sure i still know which steps to do)

I don’t think its particularly the plugin, its just ModuleScripts, not sure how those work and cant seem to find something similar to work off of


I read through that, I cant seem to find how to take the information though?

use require(path to modulescript)

So something like this would work ?

local ReplicatedStorage = game:GetService("ReplicatedStorage")
local Lighting = game:GetService("Lighting")
local makeFade = ReplicatedStorage.Events:WaitForChild("makeFade")
location = script.Parent.ObjectText
local LightModule = require(ReplicatedStorage["Custom Light Module-ID: Cave"])

	makeFade:FireClient(player, "Cave")
	Lighting.Ambient = LightModule.LightingSettings.Ambient
-- instead of 

-- do 

because they are strings, but other than that its fine

What about for the ColorShifts, would those be like this aswell?

	Lighting.ColorShift_Bottom = LightModule["LightingSettings"]["ColorShift_Bottom"]
	Lighting.ColorShift_Top = LightModule["LightingSettings"]["ColorShift_Top"]

yeah that should work (ignore this i just need the 30 letters)

Thank you!!! Got it working, had to tweak some settings to perfect it.

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.