Graal Forums  

Go Back   Graal Forums > Development Forums > NPC Scripting > New Scripting Engine (GS2)
FAQ Members List Calendar Today's Posts

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 07-18-2008, 08:40 PM
GULTHEX GULTHEX is offline
Registered User
Join Date: Jul 2008
Posts: 148
GULTHEX can only hope to improve
Exclamation Script Wep Damage

how do i make this script do damage

PHP Code:
//#CLIENTSIDE

function onCreated()

{

  
setTimer0.05 );

}

function 
onTimeOut()

{

  
replaceani"sword" );

}

setTimer0.05 );



function 
onKeyPressedcodekey )

{  

  if ( 
key == "s" && player.freezetime <= )

  {

    
setAni"dg_katana_attack"NULL );

    
freezeplayer.30 );

    
temp.txtemp.ty;

    
tx player.1.5 vecxplayer.dir )*2;

    
ty player.2   vecyplayer.dir )*2;

    
triggeractiontxty"projectile""punch"player.account );      

  }



Last edited by GULTHEX; 07-18-2008 at 08:52 PM..
Reply With Quote
  #2  
Old 07-18-2008, 08:45 PM
excaliber7388 excaliber7388 is offline
Banned
excaliber7388's Avatar
Join Date: Jul 2005
Location: US
Posts: 5,229
excaliber7388 can only hope to improve
Send a message via AIM to excaliber7388
Use [ code ] tags, it will make you script more readable.
Reply With Quote
  #3  
Old 07-18-2008, 08:45 PM
GULTHEX GULTHEX is offline
Registered User
Join Date: Jul 2008
Posts: 148
GULTHEX can only hope to improve
stay on topic
Reply With Quote
  #4  
Old 07-18-2008, 08:50 PM
LoneAngelIbesu LoneAngelIbesu is offline
master of infinite loops
LoneAngelIbesu's Avatar
Join Date: May 2007
Location: Toldeo, Ohio
Posts: 1,049
LoneAngelIbesu has a spectacular aura aboutLoneAngelIbesu has a spectacular aura about
Send a message via AIM to LoneAngelIbesu
If you're using the default hearts system, then this page might be useful. Though, are you the person that made this script? It's unfinished, if I'm understanding it correctly. You have a triggerAction, but you have no onAction to carry out the affect.

If you're new to scripting, and are just using examples from other people to learn, you should really read everything on this page first.

Also, use the PHP tags when posting scripts. It puts the code in a scroll box, and highlights it. Much easier to read.
Reply With Quote
  #5  
Old 07-18-2008, 08:52 PM
GULTHEX GULTHEX is offline
Registered User
Join Date: Jul 2008
Posts: 148
GULTHEX can only hope to improve
so where do i put "players[1].hearts"
at

and does this make it - hearts by 1
Reply With Quote
  #6  
Old 07-18-2008, 08:55 PM
excaliber7388 excaliber7388 is offline
Banned
excaliber7388's Avatar
Join Date: Jul 2005
Location: US
Posts: 5,229
excaliber7388 can only hope to improve
Send a message via AIM to excaliber7388
Quote:
Originally Posted by GULTHEX View Post
stay on topic
That was very important advice for posting code on the forums.


Trust me.

Anyway, if you're using custom animations in place of the sword, I assume this isn't a "classic" server, so you might want a custom HP system.
Reply With Quote
  #7  
Old 07-18-2008, 08:55 PM
LoneAngelIbesu LoneAngelIbesu is offline
master of infinite loops
LoneAngelIbesu's Avatar
Join Date: May 2007
Location: Toldeo, Ohio
Posts: 1,049
LoneAngelIbesu has a spectacular aura aboutLoneAngelIbesu has a spectacular aura about
Send a message via AIM to LoneAngelIbesu
PHP Code:
//#CLIENTSIDE
function onPlayerChats() {
  if(
player.chat == "/hurtme") {
    
player.hearts--;
  }

I'm only going to post an example, because you should learn how to do this yourself, instead of asking for other people to write the script for you. :P

The above will subtract 1 heart from the player every time they say /hurtme. But, as Excalibur said, you'll want a custom system if you're using custom GANIs for weapons.
Reply With Quote
Reply


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 05:45 PM.


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