Client exports
HasCard
local has, card = exports['ryan-wallet']:HasCard(names, match)
The same check as the server export, for the local player's own cards. It asks the server, so call it from a thread or any function that can wait.
Returns true, { name, metadata, inWallet } or false.
CreateThread(function()
local hasCard = exports['ryan-wallet']:HasCard({ 'visa', 'mastercard' })
if not hasCard then return lib.notify({ description = 'You need a bank card', type = 'error' }) end
-- open your ATM ...
end)
useWallet
exports['ryan-wallet']:useWallet(slot)
Takes out the wallet in that inventory slot. The wallet items do this themselves through
client = { export = 'ryan-wallet.useWallet' }; call it yourself for a radial menu or a key of your own. Called while
that wallet is out, it does what X does.
IsOut
local out = exports['ryan-wallet']:IsOut() -- true / false
true while the local player has a wallet out.
The ryanWalletOut state
if LocalPlayer.state.ryanWalletOut then return end
true on the local player's state bag while a wallet has the player's hands: from the moment it is asked for until it
is back in the pocket. Use it in your emote, inventory or interaction scripts on that client to wait for the wallet,
for example to keep an emote from starting while the wallet is out. It is client-side only: other clients and the server
do not see it.
The props other players see
Each player's wallet props reach other players through the player state bag ryanWallet. It holds the wallet's
finish, which cards are fanned, the cash tier and the prop in the hand, never a name or a number. The server checks
every value, and every client checks it again. Read it if you need to know whether another player has a wallet out:
local out = Player(serverId).state.ryanWallet ~= nil