• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

Script question

gohamvsgoku

Member
Joined
Aug 21, 2017
Messages
151
Reaction score
9
Can i have problem if i use math.random(1,200) ? In all script that i saw this function is (1,100)

Because i want a thing with less chance of (1,100)
 
Solution
Can i have problem if i use math.random(1,200) ? In all script that i saw this function is (1,100)

Because i want a thing with less chance of (1,100)
This wont be a problem. however thats not what decides the chance. For example:

Lua:
if(math.random(1,100) <= 15) then
-- do something
else
-- do something else
end
This is a 15% chance of doing something and a 85% chance of doing something else.
You can also do like this
Lua:
if(math.random(1,1000) == 1) then
-- do something
else 
-- do something else
end
now its a 0,1% chance to do something and 99,9% chance of doing something else
Can i have problem if i use math.random(1,200) ? In all script that i saw this function is (1,100)

Because i want a thing with less chance of (1,100)
This wont be a problem. however thats not what decides the chance. For example:

Lua:
if(math.random(1,100) <= 15) then
-- do something
else
-- do something else
end
This is a 15% chance of doing something and a 85% chance of doing something else.
You can also do like this
Lua:
if(math.random(1,1000) == 1) then
-- do something
else 
-- do something else
end
now its a 0,1% chance to do something and 99,9% chance of doing something else
 
Solution
Back
Top