Graal Forums  

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

 
 
Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1  
Old 02-09-2008, 05:47 AM
Knightmare1 Knightmare1 is offline
Billy Allan
Knightmare1's Avatar
Join Date: Apr 2007
Posts: 804
Knightmare1 can only hope to improve
Health System

im creating a health system for my server, and i was wondering, how do you make sure that when you damage a player that you can tell you killed them. this is what i have so far. I only spent a couple of minutes, and i was wondering, can anyone help me? i am not to good at scripting. and the server is gonna have a ranking system ( like ranks for each class. ) and class system. im still working on everything, because i have no staff xD

PHP Code:
function onActionServerSide() 

 if (
params[0] == "hurt"
 { 
  
clientr.hp -= clientr.weapon_damage;
 } 
 elseif (
params[0] == "dead")
 {
  
clientr.hp 0;
  
clientr.deaths += 1;
 }
 elseif (
params[0] == "kill")
 {
  
clientr.kills_@clientr.weapon += 1;
  
clientr.exp += 4;
  
clientr.message "You have killed " @temp.player_hit;
 }
 elseif (
params[0] == "revive")
 {
  
clientr.hp clientr.hp_max;
  
setlevel2("final_osl.nw"3030);
 }
}

//#CLIENTSIDE
function onCreated()
{
 
clientr.hp 100;
 
clientr.hp_max 100;
 
clientr.deaths 0;
 
clientr.kills 0;
 
setTimer0.05 );

__________________
I am the devil, I am here to do to devils work.
Reply With Quote
 


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 02:46 AM.


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