Here is the scripts
----Variables-------------------------- local p = script.Parent print("Test") print("Test.") ------------------functions-------------------------------------- function OnTouched(fall) local h = fall.Parent:FindFirstChild("Humanoid")---Need to rmb is hit if h ~= nil then p.BrickColor.Color = BrickColor.new(128,255,0)-- Color Codes from: http://www.rapidtables.com/web/color/RGB_Color.htm p.CanCollide = true wait(3) p.BrickColor.Color = BrickColor.new(225,0,0) p.CanCollide = false wait(3) p.BrickColor.Color = BrickColor.new(128,255,0)-- Color Codes from: http://www.rapidtables.com/web/color/RGB_Color.htm p.CanCollide = true end end script.Parent.Touched:connect(OnTouched)
Thanks!
There are two problems here, the 1st is that the BrickColor.Color is read only so you cannot set its value, you need to pass a new brick color each time.
The second is that you need to / 255 as it uses the range 0 ~ 1, more information can be found in the BrickColor Constructors.
I prefer to use:-
p.BrickColor = BrickColor.new(Color3.fromRGB(225,0,0))
But you can also use:-
p.BrickColor = BrickColor.new(225/255,0/255,0/255))
I hope this helps.
You CANNOT assign a brickcolor from RGB (red, green, blue). So you go to brickcolor in properties and hover over a color u want the color to be. REMEMBER IT IS CASE SENSETIVE. Like this
script.Parent.BrickColor = BrickColor.new("Bright green") --i dont remember where to capitalize, so this might be wrong
Gui's have colors from RGB, though. But this is a brick. Not a gui