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

Another error found in my scripts?

Well I keep seeming to find errors in this script of mine, I will ask one by one. Thank you scripting helpers for this site. Anyways, I was using a table for example:

local pies = {a,b,c,d,e,f,g}
local noobs = math.random(1, #pies)
print(noobs[pies])

What seems to be wrong?

1 comment

0

Just want to point out to you that when using random numbers, if the range starts with 1, then implying it is unneeded, just do math.random(#pies)

1 answer

✓ Accepted answer

You switched pies and noobs, should be pies[noobs]

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