Graal Forums  

Go Back   Graal Forums > Development Forums > NPC Scripting
FAQ Members List Calendar Search Today's Posts Mark Forums Read

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 02-09-2011, 01:53 AM
Starfire2001 Starfire2001 is offline
Unholy Nation
Starfire2001's Avatar
Join Date: Dec 2010
Location: The streets.
Posts: 156
Starfire2001 will become famous soon enough
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();

Reply With Quote
  #2  
Old 02-09-2011, 04:38 AM
ffcmike ffcmike is offline
Banned
Join Date: Jul 2004
Location: London
Posts: 2,029
ffcmike has a reputation beyond reputeffcmike has a reputation beyond reputeffcmike has a reputation beyond reputeffcmike has a reputation beyond reputeffcmike has a reputation beyond reputeffcmike has a reputation beyond reputeffcmike has a reputation beyond reputeffcmike has a reputation beyond repute
Send a message via AIM to ffcmike Send a message via MSN to ffcmike
Quote:
Originally Posted by Starfire2001 View Post
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)
Reply With Quote
  #3  
Old 02-09-2011, 08:55 PM
Starfire2001 Starfire2001 is offline
Unholy Nation
Starfire2001's Avatar
Join Date: Dec 2010
Location: The streets.
Posts: 156
Starfire2001 will become famous soon enough
thanks that did it
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 09:40 PM.


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