#tables giving nil on math.random
1 messages · Page 1 of 1 (latest)
Cuz index is q1
Q2
Q3
Not 1 or 2 or 3
so how do i make it choose random quests
Remove q
local RandomQuestCount = math.random(1, 3)
quests["q"..RandomQuestCount]
oh yea actually thats a better fix
** You are now Level 8! **
tysm
удачки
спасибо
Or try using 'Math.Round(Math.Random(1, 3))'
what
math.round(math.random(1, 3)) instead of just math.random(1, 3)
why
'tis
in the command bar type 'print(math.random(1, 3))'
;compile
3
aight bet
** You are now Level 4! **
yea so what you want to do is, if you want decimals, is:
minimumNumber - math.random() * (maximumNumber-minimumNumber)
local minimumNumber = 5
local maximumNumber = 10
while true do
print(minimumNumber + math.random() * (maximumNumber-minimumNumber))
end
;compile
2.9801442805726
its minimumNumber + the rest my b
;compile
7.5796537024574
5.6692583329492
9.5895640388014
7.2698188119178
7.744569280728
7.7963024632734
8.8643220274238
7.5249862517385
5.5738902844003
8.0594053898042
5.3491671144064
5.6452153617676
8.1320282915481
5.2887758581421
6.7383352760384
7.863423708
real
for me it does it in game but not when using the editor 
if you want decimals you can use an object called Random with Random.new
and then call :NextNumber specifying the min and max
i didnt ask
was not talking to you tho
ooo
дурашка полторашка 🌹
this requires creating a new string every single time it is called