Achieve
I’m trying to send a string of code to my other script to change the color of the lighting.
Issues
The issue is that the lighting doesn’t change at all. I have no idea why either.
Solutions Tried
I tried making the Color section a String, a variable and no matter what I do… it doesn’t work.
Note
I am using fromRGB for my coloring as I believe it to be quite better than the rest. Just a personal opinion.
Yes, I know the TweenLighting isn’t working. I have it set like that on purpose.
Issue part of the script
ArenaLights:Fire("Instant","ArenaLights","1,1,0",1)
Script that sends the issue
ArenaLights = spawn(function() --Arena Lights
local ArenaLights = game.ReplicatedStorage.LightingEvents.VenueLightingBindableEvent
if SettingsToggle then
repeat
ArenaLights:Fire("Instant","ArenaLights","1,1,0",1)
wait(0.5)
until not SettingsToggle
end
end)
Script that receives the data
--Made By MillerrIAm--
---------------Variables---------------
--local TweenLight = require(game.ServerScriptService["Module Scripts | Lighting"].FadeModule)
local Event = game.ReplicatedStorage.LightingEvents.VenueLightingEvent
local BindableEvent = game.ReplicatedStorage.LightingEvents.VenueLightingBindableEvent
local adminCheck = require(game.ServerScriptService["Scripts|Admins"]["ModuleScript|AdminCheck"])
local DefaultBrightness = 1
---------------Main Code---------------
Event.OnServerEvent:Connect(function(plr,Lighting,Name,Color,LightBrightness)
------------------------------------------------Remote Event---------------------------------------------------
if adminCheck.Activate(plr) then
if Lighting == "Instant" then
for i, v in pairs(game.Workspace.VenueLights[Name]:GetChildren()) do
if v:FindFirstChild("PointLight") ~= nil then
v.PointLight.Color = Color3.fromRGB(Color)
v.PointLight.Brightness = LightBrightness
end
end
-----------Fading Lights------------
elseif Lighting == "Fade" then
for i, v in pairs(game.Workspace.VenueLights[Name]:GetChildren()) do
if v:FindFirstChild("PointLight") ~= nil then
TweenLight.Tween(v.PointLight,Color3.fromRGB(Color),nil)
end
end
wait(0.01)
end
else
adminCheck.Failed(plr)
end
end)
------------------------------------------------Bindable Event---------------------------------------------------
BindableEvent.Event:Connect(function(Lighting,Name,Color,LightBrightness)
---------------Colors---------------
if Lighting == "Instant" then
for i, v in pairs(game.Workspace.VenueLights[Name]:GetChildren()) do
if v:FindFirstChild("PointLight") ~= nil then
v.PointLight.Color = Color3.fromRGB(Color)
if LightBrightness == nil then
v.PointLight.Brightness = DefaultBrightness
else
v.PointLight.Brightness = LightBrightness
end
end
end
wait(0.01)
----------Fading Lights------------
elseif Lighting == "Fade" then
for i, v in pairs(game.Workspace.VenueLights[Name]:GetChildren()) do
if v:FindFirstChild("PointLight") ~= nil then
TweenLight.Tween(v.PointLight,Color3.fromRGB(Color),nil)
end
end
wait(0.01)
end
end)
Thank you for any help you can give.