If there’s no check for negative values, you can add it yourself.
Compute your reload quantity in a variable before returning it, so that you can perform some checks on it in between, like this:
var loadable = maxclip - currentclip
var reload_quantity = totalammo - loadable
if reload_quantity < 0:
reload_quantity = 0:
return [loadable, reload_quantity]
I don’t know if that code will work perfectly, it’s just a way of sharing the idea. You can also use the min, max and clamp functions to clamp your final value.
Hey i am interesting to ask what do you want to do exactly with this?? Like something important or just want to subtract loaded bullets from the Total bullets?? And display reloadable bullets??