Jump to content
  • 0

OnPCDieEvent


tofubeng

Question


  • Group:  Members
  • Topic Count:  5
  • Topics Per Day:  0.00
  • Content Count:  13
  • Reputation:   0
  • Joined:  05/13/16
  • Last Seen:  

Hi all, currently doing a script that will revive player if death count < 3, and if more than 3 auto warp out.

 


OnPCDieEvent:

if (strcharinfo(3) == "ordeal_1-1") {

set .death,.death+1;

if(.death<3) {

announce "You have died "+.death+" times",bc_map;

dispbottom "You'll be revived in 3 seconds";

sleep2 3000;

if(HP == 0) atcommand "@alive";

percentheal 100,100;

}

else {

dispbottom "Died more than 3 times" ;

end;

}

 

}

end;


 

Edit : The script works. But how do I tie to per player? Currently it records death for everyone.

 

Thank you in advance.

 

 

}

Edited by tofubeng
Link to comment
Share on other sites

3 answers to this question

Recommended Posts

  • 0

  • Group:  Developer
  • Topic Count:  36
  • Topics Per Day:  0.01
  • Content Count:  587
  • Reputation:   431
  • Joined:  01/26/16
  • Last Seen:  

Change ".death" to "death".

Variable prefixed with a . means it is a variable attached to an NPC.

I also recommend you to change the variable name to something unique when dealing with player variable to avoid conflicts like "MyEvent_Death".

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  34
  • Topics Per Day:  0.01
  • Content Count:  386
  • Reputation:   38
  • Joined:  04/28/13
  • Last Seen:  


variables // Character variables

.variables // NPC variables

#variables // Account Variables

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  5
  • Topics Per Day:  0.00
  • Content Count:  13
  • Reputation:   0
  • Joined:  05/13/16
  • Last Seen:  

Hi Secrets, Promise,

 

Thank you for your help, and the additional info is definitely very useful for me.

 

Cheers. 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...