Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

I need help, how do I make it print a word instead of a number?

local possibilities = {"Brawler", "Bulky", "Boomer", "Loose Cannon", "Glass Cannon", "Big Brain", "Bookworm", "Lazy", "Inexperienced", "Nerd", "Runner", "Ducker", "Inaccurate", "Blitz", "Bot", "Grinder", "Persistant", "Tryhard", "Bruiser", "Rash", "Tank", "Braindead", "Casual", "Explosive", "Juggernaut", "Intellect", "Natural", "Instinctive", "Mage", "Slow Cannon"}
local textNum
for i = 1, 30 do
textNum = math.random(#possibilities)
print(textNum)
wait(2)
end

2 answers

✓ Accepted answer

To read from an array you need to add a pair of brackets after its reference and specify the index number of the element inside ([pos])

local possibilities = {"Brawler", "Bulky", "Boomer", "Loose Cannon", "Glass Cannon", "Big Brain", "Bookworm", "Lazy", "Inexperienced", "Nerd", "Runner", "Ducker", "Inaccurate", "Blitz", "Bot", "Grinder", "Persistant", "Tryhard", "Bruiser", "Rash", "Tank", "Braindead", "Casual", "Explosive", "Juggernaut", "Intellect", "Natural", "Instinctive", "Mage", "Slow Cannon"}
local textNum
for i = 1, 30 do
textNum = math.random(#possibilities)
print(possibilities[textNum])
wait(2)
end

1 comment

0

Thanks for explaining it! this really helps

local possibilities = {"Brawler", "Bulky", "Boomer", "Loose Cannon", "Glass Cannon", "Big Brain", "Bookworm", "Lazy", "Inexperienced", "Nerd", "Runner", "Ducker", "Inaccurate", "Blitz", "Bot", "Grinder", "Persistant", "Tryhard", "Bruiser", "Rash", "Tank", "Braindead", "Casual", "Explosive", "Juggernaut", "Intellect", "Natural", "Instinctive", "Mage", "Slow Cannon"}
local textNum
for i = 1, 30 do
textNum = math.random(#possibilities)
print(tpossibilities[textNum])
wait(2)
end

1 comment

0

Ohh damn thanks a lot

This discussion is preserved as it was. New answers, comments, and votes are closed.