local bet_cost = 500 function money_check( actor, npc ) if db.actor:money() >= bet_cost then return true end return false end function win_money (trader, actor) dialogs.relocate_money(trader, 500, "in") end function lose_money (trader, actor) dialogs.relocate_money(trader, 500, "out") end local actor_won function throw_coin(actor,npc) actor_won=math.random(0,100)<50 end function actor_won(actor,npc) return actor_won end function actor_loose(actor,npc) return not actor_won end