• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

Npc calculate

Joriku

Working in the mines, need something?
Joined
Jul 16, 2016
Messages
1,078
Solutions
15
Reaction score
370
Location
Sweden
YouTube
Joriku
How do i get the npc for example say "your new balance is X amount cc, platinum coins"
etc. Congratz, your new balance is 10.22cc
 
a simple/noob way
Code:
local balance = the_possibly_large_number
local cc = 0
local plat = 0
local gold = 0
while
        if balance >= 10000 then
            cc = cc + 1
            balance = balance - 10000
        elseif balance >= 100 then
            plat = plat + 1
            balance = balance - 100
        else
            gold = balance
            balance = 0
        end
until (balance == 0)

text = "You currently have " .. cc .. " cc, " .. plat .. " pc, " .. gc .. " gc invested into our bank."
-- Ex: You currently have 35 cc, 13 pc, 89gc invested into our bank.
 
Last edited:
a simple/noob way
Code:
local balance = the_possibly_large_number
local cc = 0
local plat = 0
local gold = 0
while
        if balance >= 10000 then
            cc = cc + 1
            balance = balance - 10000
        elseif balance >= 100 then
            plat = plat + 1
            balance = balance - 100
        else
            gold = balance
            balance = 0
        end
until (balance == 0)

text = "You currently have " .. cc .. " cc, " .. plat .. " pc, " .. gc .. " gc invested into our bank."
-- Ex: You currently have 35 cc, 13 pc, 89gc invested into our bank.
TFS 1.2 and im tring to make an gambling npc with commands, info, balance, withdraw, l, h (high, low) and also saying "hello player" "good bye player"
 
Back
Top