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

3 comments
Did you connect or trigger the function?
To be honest, I've never worked with Localscripts before, so probably not. That's the entire code right there.
LocalScripts only differ from normal Scripts in that they run on the Client instead of the Server. You connect events and functions exactly the same way on both.