I have made a local script inside startercharacter that when you touch a part, it changes the values of ColorCorrection inside of Workspace.CurrentCamera, but when a player touches a part the values change for all players. I do not want this, and I don’t know what’s the issue
According to a guy that tried to help me, CurrentCamera is shared? If so then why does a local script that changes the tintcolor of another ColorCorrectionEffect in CurrentCamera when taking damage working correctly?
Maybe the touched event fires for all clients?
local folder = game.Workspace.Regions
local mirage = folder.Mirage
local rust = folder.RustBelt
local sand = folder.Sandstone
local TS = game:GetService("TweenService")
local Tweeninfo = TweenInfo.new(3, Enum.EasingStyle.Quart, Enum.EasingDirection.Out)
local mirg = false
local rusty = false
local sandy = false
local ccorrection = Instance.new("ColorCorrectionEffect", game.Workspace.CurrentCamera)
ccorrection.Name = "ccRegion"
mirage.Touched:Connect(function(hit)
if hit.Parent:FindFirstChild("Humanoid") and not mirg then
mirg = true
rusty = false
sandy = false
local tween = TS:Create(ccorrection, Tweeninfo, {TintColor = Color3.fromRGB(255, 255, 160), Saturation = 0})
tween:Play()
end
end)
rust.Touched:Connect(function(hit)
if hit.Parent:FindFirstChild("Humanoid") and not rusty then
mirg = false
rusty = true
sandy = false
local tween = TS:Create(ccorrection, Tweeninfo, {TintColor = Color3.fromRGB(230, 230, 255), Saturation = -0.3})
tween:Play()
end
end)
sand.Touched:Connect(function(hit)
if hit.Parent:FindFirstChild("Humanoid") and not sandy then
mirg = false
rusty = false
sandy = true
local tween = TS:Create(ccorrection, Tweeninfo, {TintColor = Color3.fromRGB(255, 255, 160), Saturation = 0})
tween:Play()
end
end)