Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   NPC Scripting (https://forums.graalonline.com/forums/forumdisplay.php?f=8)
-   -   simple thing i can't figure out (https://forums.graalonline.com/forums/showthread.php?t=134262025)

Starfire2001 02-09-2011 01:53 AM

simple thing i can't figure out
 
When the player is killed I want them to have weapons disabled. The script disables their weapons when they are lying on the ground dead, but when they get up their weapons are enabled again. Help :(

PHP Code:

function onPlayerDies() {
  
setlevel2("jd_spar.nw",30.5,35);
  
disableweapons();



ffcmike 02-09-2011 04:38 AM

Quote:

Originally Posted by Starfire2001 (Post 1629259)
When the player is killed I want them to have weapons disabled. The script disables their weapons when they are lying on the ground dead, but when they get up their weapons are enabled again. Help :(

PHP Code:

function onPlayerDies() {
  
setlevel2("jd_spar.nw",30.5,35);
  
disableweapons();



There are probably quite alot of ways to do it but I think having a flag added to the player within your onPlayerDies function and then creating a script within the destination level like this would work:

PHP Code:

//#CLIENTSIDE
function onPlayerEnters(){
  if(
player.client.someflag){
    
player.client.someflag false;
    
this.onTimeout();
  }
}

function 
onTimeout(){
  if(
player.hearts 0){
    
disableweapons();
  }
  else{
    
this.setTimer(0.05);
  }


(although this is assuming that this problem is as a result of built-in movement and not separate scripts interfering with eachother)

Starfire2001 02-09-2011 08:55 PM

thanks that did it


All times are GMT +2. The time now is 08:27 AM.

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