So I have this localscript in a weapon. It's intended to drain the bar value of the energy GUI when you fire the weapon, but it doesn't seem to be working properly. Anyone have any clue why?
BV = Player.StarterGui.BorgGui.BarValue function onActivated() BV.Value = BV.Value - 5 end
BV = Player.StarterGui.BorgGui.BarValue function onActivated() while true do wait(1) if BV.Value > 5 then BV.Value = BV.Value - 5 elseif BV.Value =< 5 then BV.Value = 0 end end end
This should drain the energy to 0.