Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   Code Gallery (https://forums.graalonline.com/forums/forumdisplay.php?f=179)
-   -   RC Russian Roulette (https://forums.graalonline.com/forums/showthread.php?t=134270338)

fowlplay4 07-26-2016 08:55 PM

RC Russian Roulette
 
Cool RC game I made.

PHP Code:

// Add to your Control-NPC

function onRCChat() {
  if (
params[0in {"rr""russianroulette"}) {
    
rr_game();
    return;
  }
}

function 
rr_game() {
  if (
this.bullets == 0) {
    
this.bullets 6;
    
this.bullet int(random(0,6));
    
sendtorc("A new revolver has been loaded by " player.account ". /npc russianroulette to play.");
  } else {
    if (
player.account == this.lastshot) {
      
sendtorc("Wait for someone else to pull the trigger " player.account ".");
      return;
    } else {
      
this.lastshot player.account;
    }
    
this.bullets--;
    if (
this.bullets == this.bullet) {
      
sendtorc(format("/disconnect %s \"bang\""player.account));
      
this.bullets 0;
    } else {
      
sendtorc("Click! You are safe " player.account);
    }
    if (
this.bullets == 1) {
      
this.bullets 6;
      
this.bullet int(random(0,6));
      
sendtorc("The revolver cylinder has been spun.");
    }
  }



Cubes 07-27-2016 04:52 AM

could be more fun if it reset and banned someone randomly

PlanetOscar 07-27-2016 07:23 AM

:cool: Hehe, Cool

Elk 07-27-2016 09:00 AM

could be used for tedious assignments handed out to specific staffs randomly

xXziroXx 07-27-2016 03:11 PM

is this twitch chat


All times are GMT +2. The time now is 03:28 AM.

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.