Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Its possible create a random Value in the leaderstats, but in a StringValue?

Asked by 6 years ago

i want know if its possible create a random value between 6 values to put in stringvalue in leaderstats, i can do this using math random? if yes, how?

0
StringValue.Value = math.random(1,6) Vulkarin 581 — 6y
0
Well if you mean that you have 6 values already and you'd like to randomly select one then you can put them into a table and then do StringValue.Value = someTable[math.random(1,6)] Vulkarin 581 — 6y
0
like math.random(1,2,3,4,5,6) 1 = balbla 2 = lele 3 = dasldlsa 4 = asfsada 5 = asfxc 6 = asdcmasf? darkzerobits 92 — 6y
0
or myTable[1] = "A value"? darkzerobits 92 — 6y

1 answer

Log in to vote
0
Answered by
H4X0MSYT 536 Moderation Voter
6 years ago

If you mean between 6 values allready selected, but need to chose a random one, just use math.random() and associate a number with a string.

0
like math.random(1,2,3,4,5,6) 1 = balbla 2 = lele 3 = dasldlsa 4 = asfsada 5 = asfxc 6 = asdcmasf? darkzerobits 92 — 6y
0
or myTable[1] = "A value"? darkzerobits 92 — 6y
0
No, math.random accepts 2 arguments, a minimum, and maximum number. Combine with some if statemnets. H4X0MSYT 536 — 6y
Ad

Answer this question