on *:text:!coin:#:{
.msg $chan The "Coin Toss" game has now started! Say !heads or !tails to guess which will come next! To end the game type !end
set %toss $r(0,1)
describe $chan Makes the first toss and comes up $iif(%toss,Heads,Tails) $+ ! What will come next?
set %old.toss %toss
.enable #coin
}
#coin off
on *:text:!heads:#:{
set %toss $r(0,1)
if (%toss == %old.toss) && %toss {
msg $chan _3 Oops! Sorry bud! It was tails!
dec $+(%,points,.,$nick)
set %old.toss %toss
}
else {
msg $chan _3 Correct! You recieve a cookie
inc $+(%,points,.,$nick)
set %old.toss %toss
}
}
on *:text:!tails:#:{
set %toss $r(0,1)
if (%toss == %old.toss) && !%toss {
msg $chan _3 Oops you made a wrong choice! It was Heads!!
dec $+(%,points,.,$nick)
}
else {
msg $chan _3 Correct! You recieve a cookie
inc $+(%,points,.,$nick)
}
}
on *:text:!end:#:{
/msg $chan The "Coin Toss" Game has called it quits by, $nick $+ , remember to try playing again! Cya!
}
.disable #coin
unset %points*
on *:text:!points:#:{
.msg $nick You have $($+(%,points,.,$nick),2) points
}
#coin end