This is simple dice game in wich you can compete with other people. Just copy and paste it in your remotes (Alt+R) and type !roll
Let the best man win!
Have fun!
on *:TEXT:!roll*:#:{
if (%dice == on) {
/notice $nick 6 Game is already in progress.
halt
}
/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*
}
on *:TEXT:!join:#:{
if ($nick == %dicedplayer1) {
/notice $nick 6 You can`t play with yourself.
halt
}
if (%dice == $null) {
/notice $nick 6 Game hasn`t been started yet! Type !dice to start the game.
halt
}
/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 Has won!!!
/unset %dice*
halt
}
if (%diceplayer1num == %diceplayer2num) {
/msg $chan 6 It`s a tie. ROll again!
goto next
}
Although, since the trigget (text event) is set as !* it will trigger on all events made with ! in the channel, either change the main trigger or set it 1 specefic channel. and you could always add an help event,
on *:TEXT:!help:#: {
.notice $nick
}
Just to make it clear for the users ;p. So they wont ask you guys hehe.
have fun & i hope the script I made above works now.
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 hasn
t 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!