After fiddling around with ChatGPT for about an hour, I managed to create a script that did the criteria I asked:
Using Roblox Studio’s scripting language, LUA, please make a client sided script that enables a specifically named colorcorrection whenever a Roblox Character is inside the size of a part that is named the same as the colorcorrection. Make it so the specifically named parts has its own folder in workspace.
For example: A player entering a part named “green” which is within a folder in the Roblox Workspace named “ColorCorrectionParts” will enable the color correction in Lighting named “green”. Also, make it so when the player leaves the part, it disables the specifically named ColorCorrection. Have it so the script works with StarterCharacterScripts and NOT within a part.
I feel like this is relatively simple to just enable a feature if you walk inside of a part, like if I were to make it locked or anchored, but I’m also not sure because I’m not a scripter! Here is the script provided from chatgpt, if there was a more simpler way, I’d like to know
local Players = game:GetService("Players")
local RunService = game:GetService("RunService")
local Lighting = game:GetService("Lighting")
local player = Players.LocalPlayer
local char = player.Character or player.CharacterAdded:Wait()
local humanoidRootPart = char:WaitForChild("HumanoidRootPart")
local partsFolder = game.Workspace.ColorCorrectionParts -- Replace with the actual folder name containing your trigger parts
local function enableColorCorrection(correctionName)
local colorCorrection = Lighting:FindFirstChild(correctionName)
if colorCorrection and colorCorrection:IsA("ColorCorrectionEffect") then
colorCorrection.Enabled = true
end
end
local function disableColorCorrection(correctionName)
local colorCorrection = Lighting:FindFirstChild(correctionName)
if colorCorrection and colorCorrection:IsA("ColorCorrectionEffect") then
colorCorrection.Enabled = false
end
end
local function updateColorCorrection()
local characterPosition = humanoidRootPart.Position
local activeColorCorrection = nil
for _, part in ipairs(partsFolder:GetChildren()) do
if part:IsA("Part") then
local partSize = part.Size
local partPosition = part.Position
local minX = partPosition.X - partSize.X / 2
local maxX = partPosition.X + partSize.X / 2
local minY = partPosition.Y - partSize.Y / 2
local maxY = partPosition.Y + partSize.Y / 2
local minZ = partPosition.Z - partSize.Z / 2
local maxZ = partPosition.Z + partSize.Z / 2
if characterPosition.X >= minX and characterPosition.X <= maxX and
characterPosition.Y >= minY and characterPosition.Y <= maxY and
characterPosition.Z >= minZ and characterPosition.Z <= maxZ then
activeColorCorrection = part.Name
break
end
end
end
for _, part in ipairs(partsFolder:GetChildren()) do
if part:IsA("Part") then
if part.Name == activeColorCorrection then
enableColorCorrection(part.Name)
else
disableColorCorrection(part.Name)
end
end
end
end
RunService.RenderStepped:Connect(function()
updateColorCorrection()
end)