Graal Forums  

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

Closed Thread
 
Thread Tools Search this Thread Display Modes
  #1  
Old 07-18-2008, 05:30 PM
GULTHEX GULTHEX is offline
Registered User
Join Date: Jul 2008
Posts: 148
GULTHEX can only hope to improve
Exclamation [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 );
}
}

  #2  
Old 07-18-2008, 05:35 PM
Rave_J Rave_J is offline
Graal Developer
Join Date: Feb 2006
Location: Texas
Posts: 848
Rave_J can only hope to improve
Send a message via AIM to Rave_J Send a message via MSN to Rave_J Send a message via Yahoo to Rave_J
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
  #3  
Old 07-18-2008, 07:17 PM
cbk1994 cbk1994 is offline
the fake one
cbk1994's Avatar
Join Date: Mar 2003
Location: San Francisco
Posts: 10,718
cbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond repute
Send a message via AIM to cbk1994
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

__________________
  #4  
Old 07-18-2008, 07:33 PM
Skyld Skyld is offline
Script-fu
Skyld's Avatar
Join Date: Jan 2002
Location: United Kingdom
Posts: 3,914
Skyld has much to be proud ofSkyld has much to be proud ofSkyld has much to be proud ofSkyld has much to be proud ofSkyld has much to be proud ofSkyld has much to be proud of
Send a message via AIM to Skyld
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.
Closed Thread


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 07:07 PM.


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