I made this script
Script
print(tool.Handle.Color.R,tool.Handle.Color.G,tool.Handle.Color.B)
local ColoreR = tool.Handle.Color.R
local ColoreG = tool.Handle.Color.G
local ColoreB = tool.Handle.Color.B
print(ColoreR,ColoreG,ColoreB)
if ColoreR < 1 then
ColoreR = tool.Handle.Color.R+(((tool.HP.Value-100)*-1)/100)
end
if ColoreG < 1 then
ColoreG = tool.Handle.Color.G+(((tool.HP.Value-100)*-1)/100)
end
if ColoreB < 1 then
ColoreB = tool.Handle.Color.B+(((tool.HP.Value-100)*-1)/100)
end
print(ColoreR,ColoreG,ColoreB)
print(tool.Handle.Color)
Basically checks the Color3 of the tool i’m using and according to his hp (max is 100) (1 click = hp-1)
he will increase the values that are less than 1(color3 value)
At the end the tool will become totally white, losing his original color.
So if i click 10 times the value will be 0.1,0.1,0.1 [Using Black Tool]
35 times will be 0.35,0.35,0.35 [Black Tool, now Gray]
Using a Really Red Tool will be 1,0.35,0.35 [Around Pink]
That’s fantastic, yes, but when i insert in the script this
tool.Handle.Color = Color3.new(ColoreR,ColoreG,ColoreB)
The values totally go increasing randomly
Here some photos about this:
Without the last code line, as you can see i clicked 11 times using a Really Red Tool
Output = the color3 is [1,0.11,0.11]
With the last code line, clicked exactly 10 times, got the hell.
Does anyone know how to fix this problem? thanks in advance.