I made a script checking if the player has enough gold

Code
IF
(whatever condition)
AND
CharacterGetGold(_Player,_Gold)
AND
_Gold > 99
THEN
ObjectSetFlag(_Player, "hasMoney");
Proc_GiveNPCGold(_Player,CHARACTERGUID_ticketVendor_f8a54b4d-d096-4f42-a3a7-2a23d851ae26,100);


Checks if player has at least 100 gold, then if so gives NPC 100 gold. Don't know if this what you're looking for.