Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   NPC Scripting (https://forums.graalonline.com/forums/forumdisplay.php?f=8)
-   -   if hit by (https://forums.graalonline.com/forums/showthread.php?t=81759)

GULTHEX 09-11-2008 02:41 AM

if hit by
 
PHP Code:

//#CLIENTSIDE

if (weaponfired) {
  
replaceani idle,dg_mp5a2-fire;
  
replaceani walk,dg_mp5a2-walk;
  
setani dg_mp5a2-walk,;
  
freezeplayer .1;
  
setani dg_mp5a2-fire,;
  
this.angle=getangle(vecx(playerdir),vecy(playerdir));
  
this.x=playerx+vecx(playerdir)*2;
  
this.y=(playery-.5)+vecy(playerdir)*2.5;
 
shoot this.x,this.y,playerz,this.angle+random(this.maxangle*-1,this.maxangle),
    
1,0,dg_bullet,1;
}
if (
keypressed && strequals(#p(1),s)) {
replaceani idle,idle;
replaceani walk,walk;
if(
hitby)
dg_bullet
setani hurt
,;} 

when i try it if they hit by it ,it dont dont do anything
can sombody help me?????????

DrakilorP2P 09-11-2008 03:04 AM

http://forums.graalonline.com/forums...cons/icon8.gif?????????????????????????????????????????????????? ?????????????????????????????????????????????????? ???

In other news, that code isn't even syntactically valid.

GULTHEX 09-11-2008 03:23 AM

well can ya help me then lol

Programmer 09-11-2008 03:47 AM

Quote:

Originally Posted by GULTHEX (Post 1422212)
when i try it if they hit by it ,it dont dont do anything
can sombody help me?????????

One, you don't need to use the http://forums.graalonline.com/forums...cons/icon8.gif emote. :/

Two, try if (was hit) (remove the space between "was" and "hit". Bloody censor.) for the NPC. Works if the player is slashing it.

DrakilorP2P 09-11-2008 05:41 AM

Quote:

Originally Posted by Programmer (Post 1422244)
(remove the space between "was" and "hit". Bloody censor.)

Why resort to calling it "bloody"? I'm normally quite je****l, but this parenthesis drives me sliding on the metaphorical ****ch into a graf***e of angst (Incidentally, I almost hit a ***tre in the process, or was that a ****tah? I'm not quite certain, but I would prefer recycling ****tim), along with my ****hhound (a *****, if you're curious) notwithstanding.

TSAdmin 09-11-2008 06:51 AM

Quote:

Originally Posted by DrakilorP2P (Post 1422263)
Why resort to calling it "bloody"? I'm normally quite je****l, but this parenthesis drives me sliding on the metaphorical ****ch into a graf***e of angst (Incidentally, I almost hit a ***tre in the process, or was that a ****tah? I'm not quite certain, but I would prefer recycling ****tim), along with my ****hhound (a *****, if you're curious) notwithstanding.

Okay

xXziroXx 09-11-2008 12:17 PM

Drak is trying to prove how instable the censor system is by using as many valid words as possible, that the system believes is invalid.

GULTHEX 09-11-2008 04:45 PM

So is anybody gona help me or what!!!!!

xXziroXx 09-11-2008 05:13 PM

Quote:

Originally Posted by GULTHEX (Post 1422334)
So is anybody gona help me or what!!!!!

Are you blind, or just acting stupid? Try reading the posts above.

GULTHEX 09-11-2008 05:43 PM

I mean like if they get hit by the gani they play a gani!

xXziroXx 09-11-2008 05:52 PM

Quote:

Originally Posted by GULTHEX (Post 1422349)
I mean like if they get hit by the gani they play a gani!

You're not really describing your issue or what you're trying to accomplish very well in your first post, you know. How can we help you when we don't know what you're trying to achieve? From briefly looking at your script (all my eyes could stand), I believe what you're looking for is onActionProjectile.

GULTHEX 09-11-2008 05:57 PM

so i do this ?
PHP Code:

//#CLIENTSIDE
if (weaponfired) {
  
replaceani idle,dg_mp5a2-fire;
  
replaceani walk,dg_mp5a2-walk;
  
setani dg_mp5a2-walk,;
  
freezeplayer .1;
  
setani dg_mp5a2-fire,;
  
this.angle=getangle(vecx(playerdir),vecy(playerdir));
  
this.x=playerx+vecx(playerdir)*2;
  
this.y=(playery-.5)+vecy(playerdir)*2.5;
 
shoot this.x,this.y,playerz,this.angle+random(this.maxangle*-1,this.maxangle),
    
1,0,dg_bullet,1;
}
if (
keypressed && strequals(#p(1),s)) {
replaceani idle,idle;
replaceani walk,walk;
onActionProjectile
setani hurt
,;} 


Programmer 09-11-2008 08:12 PM

Quote:

Originally Posted by GULTHEX (Post 1422358)
so i do this ?
PHP Code:

//#CLIENTSIDE
if (weaponfired) {
  
replaceani idle,dg_mp5a2-fire;
  
replaceani walk,dg_mp5a2-walk;
  
setani dg_mp5a2-walk,;
  
freezeplayer .1;
  
setani dg_mp5a2-fire,;
  
this.angle=getangle(vecx(playerdir),vecy(playerdir));
  
this.x=playerx+vecx(playerdir)*2;
  
this.y=(playery-.5)+vecy(playerdir)*2.5;
 
shoot this.x,this.y,playerz,this.angle+random(this.maxangle*-1,this.maxangle),
    
1,0,dg_bullet,1;
}
if (
keypressed && strequals(#p(1),s)) {
replaceani idle,idle;
replaceani walk,walk;
onActionProjectile
setani hurt
,;} 


Try explaining what you're doing for one.

GULTHEX 09-12-2008 05:26 PM

well im trying to make it if they get hit by the bullet they play the gani hurt


All times are GMT +2. The time now is 12:30 PM.

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