How to change player lighting based on their team

I want to change player lightning based on their team,
only players on “Red” team will have red fog around them like this:

and I only want players on “Blue” team will get no fog.

I have no idea how to achieve it and I have spent way too long on that stuff.

I am very noob at scripting sorry :frowning:

1 Like
--LOCAL SCRIPT

local Game = game
local Players = Game:GetService("Players")
local Player = Players.LocalPlayer
local Lighting = Game:GetService("Lighting")

local function OnPlayerTeamChanged()
	Lighting.FogColor = Player.TeamColor.Color
end

Player:GetPropertyChangedSignal("Team"):Connect(OnPlayerTeamChanged)
OnPlayerTeamChanged()
5 Likes