How to change 1 persons lighting settings

I want to try to change someone’s lighting settings so there is only fog for 1 person. I have tried

local player = game:GetService("Players").LocalPlayer

local function onPartTouch(otherPart)

player.lighting.fogend = 10

lighingpart.Touched:Connect(onPartTouch)

how would i make it so it changes only 1 persons fog?

2 Likes

Try use a local script for that player

You can try doing it via a LocalScript. It won’t work on the server. You can use remote events to fire the client.

local Lighting = game:GetService'Lighting'
local Players = game:GetService'Players'
local LocalPlayer = Players.LocalPlayer

local function OnTouched(Touched)
	local Player = Players:GetPlayerFromCharacter(Touched.Parent)
	if Player and Player == LocalPlayer then
		Lighting.FogEnd = 10
	end
end

-- Change path to LightingPart
LightingPart.Touched:Connect(OnTouched) 
11 Likes