Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   NPC Scripting (https://forums.graalonline.com/forums/forumdisplay.php?f=8)
-   -   doing something after shoot (https://forums.graalonline.com/forums/showthread.php?t=134262230)

callimuc 02-26-2011 01:36 AM

doing something after shoot
 
Hey guys I was just messing around with the shoot command.

Now I used the projectile with the gravity and wanted to ask how i could make it like if the projectile hits the floor again, the player will do something, like say something. I already tried like adding:
PHP Code:

shoot(player.xplayer.yplayer.z+1temp.angletemp.zangletemp.power"callipumppetidle""callipumppet.png");
if (
this.z<=0) {
  
player.chat="YAY";


but the player will just say "YAY" when I fire it, not when it lands :mad:

fowlplay4 02-26-2011 01:48 AM

When a projectile hits the ground it calls onActionProjectile2(x, y, param0, param1, ...), if it's the player it calls onActionProjectile(param0, param1, ...).

I.e:

PHP Code:

//#CLIENTSIDE
function onCreated() {
  
setshootparams(player.nick);
  
shoot(player.xplayer.yplayer.z+1temp.angletemp.zangletemp.power"callipumppetidle""callipumppet.png");
}

function 
onActionProjectile(param) {
  
onActionProjectile2(player.xplayer.yparam);
}

function 
onActionProjectile2(pxpyparam) {
  
player.chat "Yay" SPC param "!";



callimuc 02-26-2011 01:49 AM

oh ok thx :D


All times are GMT +2. The time now is 05:55 PM.

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