Universal Script 📌
4.1k Views
954 Executions

JJ HUB

Universal Script 📌
avenzoantiv2
avenzoantiv2First script
1 year ago
Get an executor
Please login to perform these actions:

Does it work?

No reports yet

No reports yet. Tried it? Be the first to say.

Also noticed:

Description

Ji

View Raw
-- Auto JJS de EB até 5000 | Script por ChatGPT

-----------------------------
-- Função para converter número em extenso (até 5000)
-----------------------------
local function numeroPorExtenso(n)
    local unidades = {
        "zero","um","dois","três","quatro","cinco","seis","sete","oito","nove"
    }
    local especiais = {
        [10]="dez",[11]="onze",[12]="doze",[13]="treze",[14]="quatorze",
        [15]="quinze",[16]="dezesseis",[17]="dezessete",[18]="dezoito",[19]="dezenove"
    }
    local dezenas = {
        [2]="vinte",[3]="trinta",[4]="quarenta",[5]="cinquenta",
        [6]="sessenta",[7]="setenta",[8]="oitenta",[9]="noventa"
    }
    local centenas = {
        [1]="cem",[2]="duzentos",[3]="trezentos",[4]="quatrocentos",
        [5]="quinhentos",[6]="seiscentos",[7]="setecentos",
        [8]="oitocentos",[9]="novecentos"
    }

    local texto
    if n < 10 then
        texto = unidades[n+1]
    elseif n < 20 then
        texto = especiais[n]
    elseif n < 100 then
        local d, u = math.floor(n/10), n%10
        if u == 0 then
            texto = dezenas[d]
        else
            texto = dezenas[d].." e "..unidades[u+1]
        end
    elseif n < 1000 then
        local c, resto = math.floor(n/100), n%100
        if n == 100 then return "CEM" end
        if resto == 0 then
            texto = centenas[c]


Comments

0
Log in to join the conversation. Login
No comments yet. Be the first!

More universal scripts

See all
Script hub
178.8k
1.7M
Bumped 4 hours ago
Key System
Universal Script 📌
9.1k
31.7k
Bumped 5 hours ago
Script hub
49.9k
12.4k
Bumped 6 hours ago
Key System
Paid
Script hub
5.5M
1.1M
Bumped 10 hours ago
Key System
Script hub
20.6k
4.0k
Bumped 11 hours ago
Key System
Paid
Universal Script 📌
747
221
Approved 16 hours ago
Universal Script 📌
650
2.7k
Approved 17 hours ago