This one , I made on a boring day.
;Briefcase Game, by NightBlade
on 1:TEXT: !briefcase*:#:{
set %briefcase $rand(1,3)
if (%briefcase == 1) describe $chan pulls a pistol out of a briefcase and shoots $nick in the head
if (%briefcase == 2) describe $chan pulls a pellet gun out of a briefcase and shoots $nick in the chest
if (%briefcase == 3) describe $chan pulls out a huge wad of money and tosses it to $nick
}
Instead of setting a variable use /var, that way its local to the script and not a global variable. maybe something like:
on 1:TEXT: !briefcase:#:{
var %x $rand(1,3), %m
if (%x == 1) %m = pulls a pistol out of a briefcase and shoots $nick in the head
elseif (%x == 2) %m = pulls a pellet gun out of a briefcase and shoots $nick in the chest
else %m = pulls out a huge wad of money and tosses it to $nick
describe $chan %m
}
You could even use $r() (the same as $random()) to make it a little shorter.
So your code..
on 1:TEXT:!candy*:#:{
set %candy $rand(1,2)
if (%candy == 1) describe $chan smacks $nick over the head with an iron pan "1,0no candy for you!6"
if (%candy == 2) describe $chan gives $nick a piece of candy
}
Could be shortened to..
on 1:TEXT:!candy*:#: describe $chan $iif($r(1,2) == 2,gives $nick a piece of candy,smacks $nick over the head with an iron pan "1 $+ $chr(44) $+ 0no candy for you!6")
Notice how I had to use the $chr(44) instead of the comma in the color 1,0 part, that was to keep the $iif from treating it as a part of the $iif and therefor failing. The $+'s ofcourse were needed to rebuild 1,0 from 1 $chr(44) 0.
Keep up the coding. :)