![]() |
Little help.
Alright so what I need added onto this is a script that allows me to take .5 out of a players health in a given range of 1,1..
Heres what I have so far. //#CLIENTSIDE //up if (playerdir=0){ this.x=playerx-10; this.y=playery-20; } //left if (playerdir=1){ this.x=playerx-10; this.y=playery-10; } //down if (playerdir=2){ this.x=playerx+0.4; this.y=playery+10; } //right if (playerdir=3){ this.x=playerx-10; this.y=playery-10; } function onKeyPressed(c, k) { if (k == "a") { replaceani("idle", "idle"); replaceani("walk", "walk"); setani("idle", NULL); } } if (weaponfired) { setani pancho_katana-attack,; replaceani idle,pancho_katana-idle; replaceani walk,pancho_katana-walk; hurtplayer(.5); } |
so you want your script to actually take out .5 health from a player when you use the katana ? Because actually all it would do would be to hurt the player using the katana =P
|
I would like it to take out damage on another player.
|
just an idea, but what would be with something like:
if (weaponfired) {this.account=player.account; setani pancho_katana-attack,; replaceani idle,pancho_katana-idle; replaceani walk,pancho_katana-walk; } function onPlayerTouchsme() { if (player.account ==! this.account) hurtplayer(.5); } just an idea, and makes this roll on, I hope ^^ |
Nah soz man that doesnt work, if you can't make it hurt the other person I understand but can you tell me how to make the other person do a gani when they are hit.
|
This is the katana script:
PHP Code:
PHP Code:
|
Quote:
|
Still doesnt work but I will try experimenting
//#CLIENTSIDE //up if (playerdir=0){ this.x=playerx-10; this.y=playery-20; } //left if (playerdir=1){ this.x=playerx-10; this.y=playery-10; } //down if (playerdir=2){ this.x=playerx+0.4; this.y=playery+10; } //right if (playerdir=3){ this.x=playerx-10; this.y=playery-10; } function onKeyPressed(c, k) { if (k == "a") { replaceani("idle", "idle"); replaceani("walk", "walk"); setani("idle", NULL); } } if (weaponfired) { setani pancho_katana-attack,; replaceani idle,pancho_katana-idle; replaceani walk,pancho_katana-walk; } function onWeaponFired() { temp.dx = player.x + vecx(player.dir) * 1.5; temp.dy = player.y + vecy(player.dir) * 2; triggeraction(dx, dy, "AttackPlayer", player.account, .5); } function onActionAttackPlayer(acc, damage) { if (acc == player.account) { return; // this ends the function } if (damage <= 0) { return; } hurt(damage); setAni("HURTGANI", null); } |
Look closely at what I posted. There are two scripts there.
|
Quote:
|
Use '==' when comparing two values for equality.
Use '=' when assigning a value to a variable. Also, read: http://forums.graalonline.com/forums...ad.php?t=53858 |
Also unknownsoldier , it would be good if you had a specific weapon that all players had that you can add all the clientside effects which weapons do and such on the server your working for if they have one or not. Helps keep everything organized. And chris's script should work fine I just tested it.
|
| All times are GMT +2. The time now is 05:55 AM. |
Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.