#help 100% chance is not garentee

1 messages · Page 1 of 1 (latest)

celest apex
#
local function processSeed(seed)
    -- Extract the count (last character)
    local count = tonumber(string.match(seed, "(%d+)$")) or 0
    local base = string.match(seed, "^(.*%%)") or seed

    -- Initialize results
    local dCount, gCount = 0, 0
local rng = math.random(1,100)
    -- Roll for each chance
    for _ = 1, count do
        if rng <= 10 then  
            dCount = dCount + 1
        elseif rng <= 100 then  --its garentee bro but 
            gCount = gCount + 1
        end
    end
    print(dCount,gCount)
    -- Build the result string
    local result = base
    if dCount > 0 then
        result = result .. dCount .. "d"
    end
    if gCount > 0 then
        result = result .. gCount .. "g"
    end

    return result
end

'''

#

help plz ai gave up on this one

cinder boneBOT
#

studio** You are now Level 4! **studio

true vector
#

local function processSeed(seed)
-- Extract the count (last number in the string)
local count = tonumber(string.match(seed, "(%d+)$")) or 0
local base = string.match(seed, "^(.*%%)") or seed

-- Initialize counts
local dCount, gCount = 0, 0

-- Roll per chance
for _ = 1, count do
    local rng = math.random(1, 100)
    if rng <= 10 then
        dCount += 1
    else
        gCount += 1
    end
end

-- Print results for debug
print("Dark Rolls:", dCount, "Good Rolls:", gCount)

-- Build result string
local result = base
if dCount > 0 then
    result = result .. dCount .. "d"
end
if gCount > 0 then
    result = result .. gCount .. "g"
end

return result

end

celest apex
#

what to change

true vector
#

That’s the whole script

short flame
short flame
#

it looks like op posts 2 scripts but then i have to scroll up and see your name and its not 2 scripts, now i have to scroll past it every time i go to look at op's code

#

i don't want to keep track of a few extra comments :/

#

and checking what was changed between your version and theirs

true vector
#

Understandable

short flame
celest apex
#

yeeees

#

i just found out

#

it dont enter the for statement