Forum

> > CS2D > Scripts > Chance value to math random
Forums overviewCS2D overview Scripts overviewLog in to reply

English Chance value to math random

2 replies
To the start Previous 1 Next To the start

old Chance value to math random

X-Files
User Off Offline

Quote
how can i add chance value to a math random script ?

exapmle;
1
math.random(205,217)

i want to give more chance to 205 than other numbers but how ?
edited 2×, last 21.08.14 11:52:10 am

old Re: Chance value to math random

Rainoth
Moderator Off Offline

Quote
1
2
3
chance = {205,205,205,205,205,206,207,208}
local random = chance[math.random(1,#chance)]
print tostring(random)
To the start Previous 1 Next To the start
Log in to reply Scripts overviewCS2D overviewForums overview