Jump to content

Scooby! My Own Script


OddWorld

Recommended Posts

Okay, so i am making a mini script called WPK fun script for my clan. But i want to make a command "!betdice " You bet a number on the dice 1-10, and how much cash you want to bet it. This cash will come from the prs.cash. This is my first attempt at scripting, but this is what i have so far:

/*_____________________________________ 
|---------------------------------------| 
|-----------WPK FUN SCRIPT!-------------| 
|---------------------------------------| 
|----------By -WPK-OddWorld-------------| 
|---------------------------------------| 
|-----------------------------------| 
|-----------------------------------|                    
*/ 
  
on *:SIGNAL:mta.connect: { 
  .timer 1 2 mta.text $1 Script Reactivated 
} 
/* Scooby %a script 
alias wpk.person { 
  var %a = 0 
  while (%a < %loop) { 
    if ($+(*,$2,*) iswm $mta.nick($1,%a)) !return %a 
    !inc %a 
  } 
} 
*/ 
on *:SIGNAL:mta.command: { 
  if ($3 == !betdice) { 
    if ($4 == $null ) mta.pm $1 $2 Error: Please specify a dice number and ammount to bet, example: !betdice <dice number> <ammount> 
     
  

I'm not sure how to random the number from 1-10, then pm the player to say they won / lost, but i also want the percentage of winning to be %60, and losing %40. Is this possible? Sorry if i confused you, just tell me if you don't understand something.

I think the random number script will be:

var %a = $rand(1,10) 

But i'm a noob so i'm probably wrong :oops:

My MSN is: [email protected]

Link to comment
Yeah i do, thanks. :D

ok the only pointer is the 60:40 ratio, if ur doing numbers 1 to 10 then thats the ratio,

to do it 60:40 would mean u have to do away with the numbers 1 to 10.

i'll knock something up and see what u think.

Link to comment

Im not able to test, so trythis out...

on *:SIGNAL:mta.command: { 
  if ($3 == !betdice) prs.betdice $1- 
} 
  
alias prs.betdice { 
  var %a = $rand(1,10) 
  if ($hget(prstemp $+ $2,timertest) == on) mta.pm $1 $2 Please Wait...Command Can Only Be Used Once Every 30Secs. 
  elseif ($hget(pgstemp,allow $+ $2) == no) mta.pm $1 $2 Plz Try Later - Accessing Details! 
  elseif (($4 > 10) || ($4 < 1) || ($4 !isnum) || ($5 !isnum)) { 
    mta.pm $1 $2 Error - !betdice <1-10> <amount> 
  } 
  elseif ($5 > $pgs.cash($1,$2)) mta.pm $1 $2 Error - You Only Have $ $+ $pgs.cash($1,$2) 
  else { 
    pgs.sub $mta.nick($1,$2) $5 
    !hadd -u30 prstemp $+ $2 timertest on 
    mta.pm $1 $2 Rolling the dice... 
    if (%a == $4) .timer 1 5 prs.rollwin $1 $2 %a $5 
    else .timer 1 5 prs.rolllose $1 $2 %a $5 
  } 
} 
  
alias prs.rollwin { 
  var %a = $calc($4 * 10) 
  pgs.add $mta.nick($1,$2) %a 
  mta.pm $1 $2 You rolled a $3 $mta.nick($1,$2) $+ , $ $+ %a added to your cash. 
} 
  
alias prs.rolllose { 
  mta.pm $1 $2 You rolled a $3 $mta.nick($1,$2) $+ , you just lost $ $+ $4 
} 

any problems with it, or anything u need changing, just let me know

Edited by Guest
Link to comment
  • 3 months later...
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...