Lindrian commented on a Page, Dice game  -  Feb 12, 2007

Okay, I did some \"fixes\" dunno if it\'ll work, I made it quickly, u can test it yourself :p..

;-------------------------------------
;here it is:
on :TEXT:!:#:{
;i\'ve set em all into 1 text event, looks better.
if ($2 == roll) && ($3 == on) {
if (%dice == on) {
.notice $nick 6 Game is already in progress.
goto end
;added an \'goto end\' loop instead of halt.
}
if ($2 == roll) && ($3 == off) {
;the 2 statements in the if statement is due to the way i\'ve set the text ;event up.
if (%dice == off) {
.notice $nick The game is already disabled.
goto end
}
else {
set %dice off
.notice $nick the game is now disabled.
goto end
}
else {
set %dicedplayer1 $nick
set %dice on
msg $chan 6 %dicedplayer1 has began the game and you have 30 seconds to write !join
.timer72 1 30 msg $chan 6SOrry, %dicedplayer1 nobody joined your game!
.timer73 1 30 unset %dice | goto end
;i\'ve also put . infront of timers & notices, to make them \'silent\'.
}
}
elseif ($2 == join) {
if ($nick == %dicedplayer1) {
.notice $nick 6 You cant play with yourself. goto end } } elseif (%dice == $null) { .notice $nick 6 Game hasnt been started yet! Type !dice to start the game.
goto end
}
else {
;added an else statement here and above, to make the event get executed.
.timer72 off
.timer73 off
goto next
:next
set %dicedplayer2 $nick
set %diceplayer1num $rand(1,6)
set %diceplayer2num $rand(1,6)
msg $chan 6 Game has been started...
msg $chan 6 $+ %dicedplayer1 $+ \'s rolls ---> %diceplayer1num
msg $chan 6 $+ %dicedplayer2 $+ \'s rolls ---> %diceplayer2num
}
if (%diceplayer1num > %diceplayer2num) {
msg $chan 4 $+ %dicedplayer1 won!
unset %dice

goto end
}
if (%diceplayer1num < %diceplayer2num) {
msg $chan 4 $+ %dicedplayer2 won!
unset %dice*
goto end
;also added this line, so the player number 2 can win aswell.
}
if (%diceplayer1num == %diceplayer2num) {
msg $chan 6 It`s a tie. ROll again!
goto next
}
:end
;and here\'s the ending loop.
}
}

;----------------------------

Enjoy! And feel free to fix any of the bugs u might find! We\'re both here to learn after all!

 Respond  
Are you sure you want to unfollow this person?
Are you sure you want to delete this?
Click "Unsubscribe" to stop receiving notices pertaining to this post.
Click "Subscribe" to resume notices pertaining to this post.