Hello, i wanted to make a tint color go red after a amount of time I added a color correction to camera and added this in there :
wait (27) script.Parent.TintColor = ("255, 255, 255")
But it didn't work so i tried a local script :
local wait (27) script.Parent.TintColor = ("255, 255, 255") end
But none of them changes the tint.
Also here is the adrees of the Script :
Camera ColorCorrection Script/LocalScript
Couple things wrong with your code.
First and foremost, having a local
on top of your script does not make your script local script.
Please consider learning the difference between local script and server script. Also, please do not forget to learn about what exactly local
is and why we use them.
You are also assigning the color values incorrectly. When specifying the color for any object, you are required to use the color3
table. For sake of readability, we use color3.fromRGB()
.
This function requires 3 arguments, all of them are integers.
We only have end
when we are finished using a new scope we created. In this case, you are using it as a way to end the script. This is incorrect. We do not have end in the bottom of the script if you have not declared any scope whatsoever.
Please learn what exactly scope is to understand this.
Thus, your final script should be similar to, but not entitled to:
wait(27); script.Parent.TintColor = Color3.fromRGB(255, 0, 0); -- Bright Red Colour (255, 0, 0)
Also, consider declaring a variable for the TintColor.
First of all, you're making a string instead of a number.
(EDIT) I've searched and TintColor is part of a ColorCorrection effect. Changing TintColor was also strange as choosing the RGB choice of 1, 1, 1 gave you 255, 255, 255. But now the answer is correct.
local R = 255 -- change this to whatever you want local G = 255 -- change this to whatever you want local B = 255 -- change this to whatever you want wait(27) script.Parent.TintColor = Color3.new(R / 255, G / 255, B / 255)
first of all, just putting a line
local
with nothing else on the line doesn't make sense and doesn't do anything. And you should know 255,255,255 is white (a.k.a. the default color correction) instead of red. And there's no class called Color, it's Color3. Your code should be:
wait(27) script.Parent.TintColor = Color3.new(1,0,0) -- Roblox uses OpenGL, and OpenGL uses a range of 0 to 1 for colors.
But for people who wanna do it an other way here's:
wait(27) script.Parent.TintColor = Color3.fromRGB(255,0,0)
You're new to scripting aren't ya ;)