menu
Roblox Forum Archive
Home
User Search
Forums
Donate
search
settings
Home
User Search
Forums
Donate
launch
Go to User Dashboard
Forums
Scripting Helpers
Is it possible to make a random event?
chevron_left
chevron_left
chevron_left
of
1
chevron_right
chevron_right
chevron_right
Is it possible to make a random event?
Bowserking64
Join Date: 2008-11-15
Post Count: 6440
#36320536
Sunday, October 31, 2010 11:23 PM GMT
I have a drop weapon in my enemy. Now i dont want him to drop every time he dies. only sometimes... is there a way to do that?
Go to point in time
arrow_right
10 minutes before
5 minutes before
At time of posting
5 minutes after
10 minutes after
more_horiz
crazypotato4
Join Date: 2010-02-22
Post Count: 20000
#36320588
Sunday, October 31, 2010 11:24 PM GMT
(when he dies) local dropRate = math.random(1,3) if dropRate == 1 then (drop the weapon) else (don't drop the weapon) end
Go to point in time
arrow_right
10 minutes before
5 minutes before
At time of posting
5 minutes after
10 minutes after
more_horiz
brainiac680
Join Date: 2009-03-07
Post Count: 2000
#36320679
Sunday, October 31, 2010 11:26 PM GMT
i would do something like: db = math.random(1,maxprobability you want) if db == 1 then dropweaponfunction() end just change that to fit your script.
Go to point in time
arrow_right
10 minutes before
5 minutes before
At time of posting
5 minutes after
10 minutes after
more_horiz
Bowserking64
Join Date: 2008-11-15
Post Count: 6440
#36321149
Sunday, October 31, 2010 11:37 PM GMT
@Brain Thanks it works :)
Go to point in time
arrow_right
10 minutes before
5 minutes before
At time of posting
5 minutes after
10 minutes after
more_horiz
chevron_left
chevron_left
chevron_left
of
1
chevron_right
chevron_right
chevron_right