SFS - Banking System
What is SFS - Banking?
This system is designed for games with need of a more secure, easy to use, and advanced economy system. This system supports many more advanced features, as well as offers features to prevent dataloss as well as prevent economy 'fraud'. This sytem uses an Object-Oriented module, in order to allow it to be directly integrated into your scripts using familiar functions.
What features does SFS - Banking offer?
There are many features that Banking offers, such as:
- Bank & Wallet support
- Optionally supports bank transfers to other players, along with daily / player limits, as well as optional transfer fees.
- Optionally allows players to claim 'interest' which increases over a time period that you can adjust.
- Secure system, ensures that no exploiters can take advantage.
- Uses a notification system that relays information to the user (This is automatic, and will happen when using certain methods such as SubtractBalance, etc.).
- Object-Oriented functions to allow you to use familiar methods to control players economy. This allows custom uses, such as ATM's, Shops, and practically anything you can imagine.
What else is special about SFS - Banking?
This banking script was designed to be integrated with your own scripts. While standalone it will function, it comes with tons of easy to use functions and methods that you can use to add your own uses. It uses a BindableFunction on the client, that you can reference in your own LocalScripts in order to control the system's client-side. On the server, you can require the AccountManager module and use the functions there. Both of these methods are shown below.
Integration Documentation
Welcome to SFS Banking
Below is a guide on how to implement and use this resource.
# Setup
Configure the settings, and use the optional included ATM model if needed.
# Requiring the module
First, require the module (path by default ServerScriptService.SFS_ServerScripts.Banking.AccountManager)
This is necessary for all the following sections
# Account Operations
First steps to any bank account management is to get the Player's bank account
To do this use the function .getPlayerBankAccount(Player) e.g:
local playerAccount = module.getPlayerBankAccount(Player)
From there, you can perform a number of different operations, a list is as follows:
- Authorative Management
> This is not to be used for purchases
playerAccount:AddBalance(Amount) | Adding balance a bank account
playerAccount:AddWalletBalance(Amount) | Adding balance to Wallet
playerAccount:SubtractBalance(Amount) | Subtract balance from a bank account !! This should not be used for purchases
playerAccount:SubtractWalletBalance(Amount) | Subtract balance from a bank account !! This should not be used for purchases
!! These methods do not check the minimum balance, and can cause the account to go into negatives !!
- Implementing Purchases
> To implement custom item purchases
playerAccount:AttemptPurchase(Amount) | Withdraws from Bank - Returns true / false, depending on the outcome of the transaction
playerAccount:AttemptWalletPurchase(Amount) | Withdraws from Wallet - Returns true / false, depending on the outcome of the transaction
e.g:
local completedTransact = playerAccount:AttemptPurchase(1000)
if completedTransact then
-- your code to grant product
end
- Balance Checking
playerAccount:GetBalance() | Returns balance of Players bank as an integer
playerAccount:GetWalletBalance() | Returns the ballance of Players wallet as an integer
# Client Interactions
To interact with the client, use the BindableFunction ClientInteractions
Example code:
local clientInteractions = game:GetService("ReplicatedStorage").SFS_RemoteEvents.Banking.ClientInteractions
local completed = clientInteractions:Invoke("ToggleUI")
> completed = true, since if no data is returned it will always be a bool
Below is a list of all valid input
ToggleUI | Returns {bool} of .Visible property
GetBankInfo | Returns {table}: 1 = bool Success, 2 = Table
CalculateTransfer [Amount] | Returns {table}: (int) Fees, RemainingBalance
GetInterest | Returns {table}: 1 = bool Success, 2 = Amount/ErrorMessage
AttemptTransfer [PlayerName,Amount] | Returns {table}: 1 = bool Success,
# Extra info
Anything else needed can be found in the AccountManager / InterestCalculator ModuleScript, by reading the code
Where can I get SFS - Banking?
Get the loader here
Alternatively, you can directly get the MainModule here: MainModule
UI Screenshots:
Light Theme:
Next Steps:
Notes & Credits:
This system uses TopbarPlus v2 by ForeverHD, found here: TopbarPlus
This system uses the DraggableModule by Spynaz, found here: DraggableModule
This system (along with all other SFS Modules) loads the SFS Package Manager module found here: Package Manager
Created by RlGHTEOUS