CreatorsServer exports
RemoveMoney
Last updated on
Takes money from a connected player.
local res = exports.opx_infinity:RemoveMoney(source, moneyType, amount, reason)Scope write · await it. It answers from memory today, but it is a write: use the promise form.
Parameters
-
source:
number -
moneyType:
string -
amount:
integer -
reason?:
string -
Money types are the server's
MONEY.TYPES(EDDIES,BANKshipped). -
amountis a whole number from 1 to 9 999 999 999. -
reasonis optional text, cut to 64 characters, stored asext:<your resource>:<reason>. -
Runs the same hooks as any other change and raises
opx:on:character:money.
Returns
integer— the new balance
Errors
money.badType,money.badAmount,money.tooLarge,money.vetoed,money.insufficient,error.notLoggedIn,export.badArgument
CreateThread(function()
local pending, why = Open77.exports.call('opx_infinity', 'RemoveMoney', playerId, 'EDDIES', 12, 'burrito')
if not pending then return print('not sent: ' .. tostring(why)) end
local res = pending:await()
if not (res and res.ok) then return print('refused: ' .. tostring(res and res.error)) end
giveBurrito(playerId)
end)