Skip to main content
The Loans component manages vehicle and property loans, payment schedules, and the credit score system.

Overview

Access via Loans (server-side only).

Vehicle Loans

Finance vehicle purchases

Property Loans

Finance property purchases

Payments

Scheduled loan payments

Credit Score

Player credit management

Loan Management

Loans:GetAllowedLoanAmount

Get how much a character can borrow based on their credit score.
Loans:GetAllowedLoanAmount(stateId, type)
stateId
number
required
Character State ID
type
string
Loan type: 'vehicle' or 'property' (defaults to 'vehicle')
result
table
{creditScore = number, maxBorrowable = number}
Example:
local loanInfo = Loans:GetAllowedLoanAmount(char:GetData('SID'), 'vehicle')

print('Credit Score:', loanInfo.creditScore)
print('Max Borrowable: $' .. loanInfo.maxBorrowable)

Loans:GetPlayerLoans

Get all active loans for a character.
Loans:GetPlayerLoans(stateId, type)
stateId
number
required
Character State ID
type
string
Filter by type: 'vehicle' or 'property'
loans
table
Array of active loan records

Loans:CreateVehicleLoan

Create a loan for a vehicle purchase.
Loans:CreateVehicleLoan(targetSource, VIN, totalCost, downPayment, totalWeeks)
targetSource
number
required
Player server ID
VIN
string
required
Vehicle identification number
totalCost
number
required
Total vehicle price
downPayment
number
required
Down payment amount
totalWeeks
number
required
Number of weekly payments
success
boolean
true if loan was created
Example:
-- Player buying a vehicle on finance
local success = Loans:CreateVehicleLoan(source, vehicleVIN, 85000, 20000, 12)

if success then
    TriggerClientEvent('mythic-notifications:client:Send', source, {
        message = 'Vehicle loan approved! 12 weekly payments.',
        type = 'success'
    })
end

Loans:CreatePropertyLoan

Create a loan for a property purchase.
Loans:CreatePropertyLoan(targetSource, propertyId, totalCost, downPayment, totalWeeks)
targetSource
number
required
Player server ID
propertyId
string
required
Property identifier
totalCost
number
required
Total property price
downPayment
number
required
Down payment amount
totalWeeks
number
required
Number of weekly payments
success
boolean
true if loan was created

Loans:MakePayment

Make a payment on an active loan.
Loans:MakePayment(source, loanId, inAdvanced, advancedPaymentCount)
source
number
required
Player server ID
loanId
string
required
Loan identifier
inAdvanced
boolean
Whether this is an advance payment
advancedPaymentCount
number
Number of advance payments to make
result
table
{success = true, paidOff = boolean, paymentAmount = number, creditIncrease = number} on success, or {success = false, message = string} on failure
Example:
local result = Loans:MakePayment(source, loanId, false)

if result.success then
    if result.paidOff then
        TriggerClientEvent('mythic-notifications:client:Send', source, {
            message = 'Loan fully paid off! Credit +' .. result.creditIncrease,
            type = 'success'
        })
    else
        TriggerClientEvent('mythic-notifications:client:Send', source, {
            message = 'Payment of $' .. result.paymentAmount .. ' processed',
            type = 'success'
        })
    end
else
    TriggerClientEvent('mythic-notifications:client:Send', source, {
        message = result.message,
        type = 'error'
    })
end

Loans:HasRemainingPayments

Check if an asset (vehicle/property) still has an active loan.
Loans:HasRemainingPayments(assetType, assetId)
assetType
string
required
'vehicle' or 'property'
assetId
string
required
VIN or property ID
hasPayments
boolean
true if the asset has remaining loan payments

Loans:GetDefaultInterestRate

Get the default interest rate for loans.
Loans:GetDefaultInterestRate()
rate
number
Interest rate percentage (default: 15)

Credit Score

Loans.Credit:Get

Get a character’s credit score.
Loans.Credit:Get(stateId)
stateId
number
required
Character State ID
score
number
Credit score (min: 100, max: 1250, default: 180)

Loans.Credit:Set

Set a character’s credit score directly.
Loans.Credit:Set(stateId, newVal)

Loans.Credit:Increase

Add to a character’s credit score.
Loans.Credit:Increase(stateId, increase)

Loans.Credit:Decrease

Subtract from a character’s credit score.
Loans.Credit:Decrease(stateId, decrease)

Credit Score Config

SettingValue
Default score180
Maximum1,250
Minimum100
Loan payment bonus60-140 points
Loan completion bonus15-20 points
Missed payment penalty-15 points
Loan default penalty-35 points
Job bonus (police/ems/realestate)+250-300 points

Loan Config

SettingValue
Default interest rate15%
Payment interval7 days (604,800 seconds)
Missed payment limit4
Missed payment interest increase+2.5% per miss
Missed payment charge5% of loan
Default charge15% of loan

Next Steps

Finance - Banking

Bank account operations

Finance - Payments

Bills and fines

Finance - Crypto

Cryptocurrency system