I am trying to make it so that if you stand on a certain colored block, your screen gets tinted that color. So far, nothing I have tried is working. Please help!
player = game.Players.LocalPlayer green = game.Workspace.Sections:WaitForChild(game.Workspace.Sections.Green) blue = game.Workspace.Sections:WaitForChild(game.Workspace.Sections.Blue) yellow = game.Workspace.Sections:WaitForChild(game.Workspace.Sections.Yellow) red = game.Workspace.Sections:WaitForChild(game.Workspace.Sections.Red) local cCorrect = Instance.new("ColorCorrectionEffect", game.Lighting) red.Touched:connect(function(hit) if hit.Parent.Name ~= player.Name then return end cCorrect.TintColor = Color3.new(255/255, 183/255, 184/255) end) green.Touched:connect(function(hit) if hit.Parent.Name ~= player.Name then return end cCorrect.TintColor = Color3.new(162/255, 255/255, 147/255) end) yellow.Touched:connect(function(hit) if hit.Parent.Name ~= player.Name then return end cCorrect.TintColor = Color3.new(254/255, 255/255, 171/255) end) blue.Touched:connect(function(hit) if hit.Parent.Name ~= player.Name then return end cCorrect.TintColor = Color3.new(148/255, 148/255, 255/255) end)
It is a local script with this format: game > Workspace > Sections > LocalScript
Easy answer,WaitForChild
works for strings.
player = game.Players.LocalPlayer green = game.Workspace.Sections:WaitForChild("Green") blue = game.Workspace.Sections:WaitForChild("Blue") yellow = game.Workspace.Sections:WaitForChild("Yellow") red = game.Workspace.Sections:WaitForChild("Red")