Chance script?

Hi there. Is there such a script that allows to do chance? I mean like this:



with 50% chance
{
do this
}
else
{
do that
}


Thanks you for help!


(User was banned for this post ("undescriptive thread title" - Gran PC))


local gamble = math.random(100)
if gamble > 50 then
//win
end
if gamble < 50 then
//lose
end

25% would be 25 etc.