The green neon parts are meant to fade to black slowly as the ammo decreases. Am using the FE Gun Kit and I thought that in the GunClient script in the updateGui function I could make the color of the neon parts to black depending on the ammo.
EXAMPLE: if the ammo is as 50/100 the neon will be half way to color black instead of fully green.
It would be nice if anyone told me how to make a script where the part will change color depending on the value
For example if you think of your Ammo value as 1-50 you can calculate the percentage of that value. This value can be used with TweenService to change the Color of the ammo canister.
As the Scripting Support topic instructions state, do not ask people to make scripts for you.
Give the sample script from the TweenService link I posted above a look and try to change it for your application. If it doesn’t work then you can at least post what you’ve tried and others can help you.
I tried searching for sample codes of tweening color depending on value but I couldn’t find anything, I wouldn’t have a clue on how to do it myself.
local ammo = 50
local maxammo = 100
local fullcolor = Color3.new(0,1,0) -- Green
local emptycolor = Color3.new(1,0.2,0.2) -- Red
part.Color = fullcolor:Lerp(emptycolor, (maxammo-ammo)/maxammo)
-- OR:
part.Color = emptycolor:Lerp(fullcolor, ammo/maxammo)