maybe remove the local
?
i dont think its needed and it may block it because its in a function from where its being executed
dont forget to add a player instance before the custom values
(function(Player,Amount, TrueOrFalse)
just in case you changed it