Something
public lua v1 · immutablelocal bet_cost = 500 function money_check( actor, npc ) if db.actor:money() >= bet_cost then return true end return falseendfunction win_money (trader, actor) dialogs.relocate_money(trader, 500, "in")end function lose_money (trader, actor) dialogs.relocate_money(trader, 500, "out")endlocal actor_won function throw_coin(actor,npc) actor_won=math.random(0,100)<50endfunction actor_won(actor,npc) return actor_wonendfunction actor_loose(actor,npc) return not actor_wonend