Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
-2

Local Lighting [Some help with Client and Server] How can i make this work?

Asked by 9 years ago

I'm Making a Local Lighting but to make this run i need to make the FilteringEnabled = True.

But the FilteringEnabled make my whole game stop working :c. Some ppl told me to use something like FireClient, but i have no idea how to use that. Can someone please help me?

LocalScript:

repeat wait() until game.Players.LocalPlayer
local plr = game.Players.LocalPlayer
local L = game:service("Lighting")
local LI = plr:findFirstChild("Lighting")
local am,br,bt,tp,sh,gl,td,fc,fe,fs,oa

function New(c,n,v)
local new = Instance.new(c,LI) 
new.Name = n 
new.Value = v or new.Value 
return new
end

if not LI then
LI = Instance.new("ObjectValue",plr)
LI.Name = "Lighting"
am = New("Color3Value","Ambient",Color3.new(0,0,0))
br = New("NumberValue","Brightness",0)
bt = New("Color3Value","ColorShift_Bottom")
tp = New("Color3Value","ColorShift_Top")
sh = New("Color3Value","ShadowColor",Color3.new(0/255,0/255,0/255))
gl = New("NumberValue","GeographicLatitude",41.733)
td = New("StringValue","TimeOfDay","22:00:00")
fc = New("Color3Value","FogColor",Color3.new(0/255,0/255,0/255))
fe = New("NumberValue","FogEnd",200000)
fs = New("NumberValue","FogStart")
oa = New("Color3Value","OutdoorAmbient",Color3.new(0,0,0))
else
am,br,bt,tp,sh,gl,td,fc,fe,fs,oa = LI.Ambient,LI.Brightness,LI.ColorShift_Bottom,LI.ColorShift_Top,LI.ShadowColor,LI.GeographicLatitude,LI.TimeOfDay,LI.FogColor,LI.FogEnd,LI.FogStart,LI.OutdoorAmbient
end

local all = {am,br,bt,tp,sh,gl,td,fc,fe,fs,oa}

function Update()
for i,v in pairs(all) do
if (L[v.Name] ~= v.Value) then
L[v.Name] = v.Value
end
end
end

plr,LI = nil,nil

L.Changed:connect(Update)
for i,v in pairs(all) do
v.Changed:connect(function()
L[v.Name] = v.Value
end)
end
Update()

0
I have seen this very same code by another user; You did not create it. TheeDeathCaster 2368 — 9y
0
Kohl made it. I'm making it work to do something in the future. jeffreyubi 0 — 9y

1 answer

Log in to vote
1
Answered by 6 years ago
Edited 6 years ago

make your own scripts, you really shouldnt try to edit stuff u dont understand

Ad

Answer this question