I will keep my writing short, I’m trying to change lighting properties client-sided when player touches the parent. (part that the script is in it)
Server sided code works perfectly but I need to know how can I turn this scripts into a client-sided script?
My code:
local light = game.Lighting
script.Parent.Touched:Connect(function(part)
local humanoid = part.Parent:FindFirstChild("Humanoid")
if humanoid then
light.FogEnd = 100000
light.FogStart = 0
light.TimeOfDay = 14.5
light.Brightness = 2
light.FogColor = Color3.fromRGB(0,0,0)
light.Ambient = Color3.fromRGB(165,165,165)
light.OutdoorAmbient = Color3.fromRGB(165,165,165)
end
end)
You can just suggest me a method or just s e n d t h e w h o l e c o d e
You would probably want to, make a remote event in replicated storage, and fire the client through the server, with :FireServer() in a server script in Server Script Service
And take the event on the client side, by: .OnClientEvent in a local script in StarterGUI
And connect a function to it, and then change the lighting however you wish.