Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   New Scripting Engine (GS2) (https://forums.graalonline.com/forums/forumdisplay.php?f=153)
-   -   Script Wep Damage (https://forums.graalonline.com/forums/showthread.php?t=80540)

GULTHEX 07-18-2008 08:40 PM

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 );      

  }




excaliber7388 07-18-2008 08:45 PM

Use [ code ] tags, it will make you script more readable.

GULTHEX 07-18-2008 08:45 PM

stay on topic

LoneAngelIbesu 07-18-2008 08:50 PM

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.

GULTHEX 07-18-2008 08:52 PM

so where do i put "players[1].hearts"
at

and does this make it - hearts by 1

excaliber7388 07-18-2008 08:55 PM

Quote:

Originally Posted by GULTHEX (Post 1404191)
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.

LoneAngelIbesu 07-18-2008 08:55 PM

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.


All times are GMT +2. The time now is 05:25 AM.

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