Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   NPC Scripting (https://forums.graalonline.com/forums/forumdisplay.php?f=8)
-   -   [Request] Health sys that makes my script do damage. (https://forums.graalonline.com/forums/showthread.php?t=80531)

GULTHEX 07-18-2008 05:30 PM

[Request] Health sys that makes my script do damage.
 
can you make a health system that lets this script do damage



//Made By Gulthex
//Only Works With A Health System o.O

NPC Code:
//#CLIENTSIDE
function onCreated()
{
setTimer( 0.05 );
}
function onTimeOut()
{
replaceani( "sword" );
}
setTimer( 0.05 );

function onKeyPressed( code, key )
{
if ( key == "s" && player.freezetime <= 0 )
{
setAni( "dg_katana_attack", NULL );
freezeplayer( .30 );
temp.tx, temp.ty;
tx = player.x + 1.5 + vecx( player.dir )*2;
ty = player.y + 2 + vecy( player.dir )*2;
triggeraction( tx, ty, "projectile", "punch", player.account );
}
}


Rave_J 07-18-2008 05:35 PM

Just to let you know ur not supposed to ask for scripts on this fourm
when u get stuck on a script u post that part u are stuck on and
try to get help so u can go on

cbk1994 07-18-2008 07:17 PM

Fix your triggeraction ...

triggeraction( dx, dy, "HitPlayer", player.account, player.guild );

to something like that.

Then use

PHP Code:

function onActionHitPlayeraccguild )
{
  
// You've been hit, now subtract some HP



Skyld 07-18-2008 07:33 PM

http://forums.graalonline.com/forums...cement.php?f=8
Quote:

1. Be clear on your ability level. In other words, do not post asking for scripts, or asking people to fix scripts that are above your ability level. If you are writing a script to aid learning, then try writing a simpler script. If you are looking for a script for a server, then the best solution is probably to hire a scripter.

2. Similarly, do not just post whole scripts for people as a response to their difficulties. If you wish to post a wordy solution, then please feel free; however, please do not post things that people can just copy and paste. It isn't helping people to learn just by doing so. If you'd like to show off your scripts to others, post them in the Code Gallery subforum.
Please read the subforum guidelines before posting.


All times are GMT +2. The time now is 08:29 PM.

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