Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   NPC Scripting (https://forums.graalonline.com/forums/forumdisplay.php?f=8)
-   -   Another Script That will Not work but this is harder..lol (https://forums.graalonline.com/forums/showthread.php?t=12995)

dragoonvenganc 09-26-2001 09:35 AM

Another Script That will Not work but this is harder..lol
 
first npc
if (playersays(Buy Pick)&& playerrupees>=39){toweapons Pick;playerrupees-=40;
setstring client.pickstrength,#v(strtofloat(#s(client.pickst rength))+100); }


if (weaponfired) {
setstring client.pickstrength,#v(strtofloat(#s(client.pickst rength))-.4)
triggeraction playerx+.5+vecx(playerdir)*2,playery+1+vecy(player dir)*2,mining,;
setani jaxe,pickaxemetal.png;}


OK now the first part works but this does not

if (created){setimg jrock.gif;this.power=100;timeout=.1}
if (timeout){

if (actionmining) {
this.power -= 5;
if (this.power<=0) {
setstring client.playeriron,#v(strtofloat(#s(client.playerir on))+1);
destroy;}}timeout=.1}


Should i even need the timeouts.. But the second part does not work the trigger action does not work ..

KJS 09-26-2001 10:23 AM

Re: Another Script That will Not work but this is harder..lol
 
ok my first question is this server going to be p2p? I say that cuz I am just wondering...
Quote:

Originally posted by dragoonvenganc
if (playersays(Buy Pick)&& playerrupees>=39){toweapons Pick;playerrupees-=40;
setstring client.pickstrength,#v(strtofloat(#s(client.pickst rength))+100); }
if (weaponfired) {
setstring client.pickstrength,#v(strtofloat(#s(client.pickst rength))-.4)
triggeraction playerx+.5+vecx(playerdir)*2,playery+1+vecy(player dir)*2,mining,;
setani jaxe,pickaxemetal.png;}

jw do you want the axe power to go down every time they swing or just when they hit the thing (I would say just when they hit the thing cuz it gives it a more realistic thing like things dont get dull unless you hit something with it)
setstring client.pickstrength,#v(strtofloat(#s(client.pickst rength))-.4)

that is the line you would ahve to change and put in the triggeraction insted of here
try
NPC Code:

if (playersays(Buy Pick)&&playerrupees>=39){
toweapons Pick;
playerrupees-=40;
setstring client.pickstrength,#v(strtofloat(#s(client.pickst rength))+100);
}
if (weaponfired) {
setstring client.pickstrength,#v(strtofloat(#s(client.pickst rength))-.4)
triggeraction playerx+1.5+vecx(playerdir)*2,playery+1.5+vecy(pla yerdir)*2,mining,;
setani jaxe,pickaxemetal.png;
}



Quote:


if (created){setimg jrock.gif;this.power=100;timeout=.1}
if (timeout){

if (actionmining) {
this.power -= 5;
if (this.power<=0) {
setstring client.playeriron,#v(strtofloat(#s(client.playerir on))+1);
destroy;}}timeout=.1}

try
NPC Code:

if (created){setimg jrock.gif;this.power=100;timeout=.1}
if (actionmining) {
this.power -= 5;
if (this.power<=0) {
setstring client.playeriron,#v(strtofloat(#s(client.playerir on))+1);
destroy;
}
}


dragoonvenganc 09-26-2001 08:29 PM

OK i will try when i get home
 
You changed

triggeraction playerx+1.5+vecx(playerdir)*2,playery+1.5+vecy(pla yerdir)*2,mining,;

ok i will try but i had the npc message the playerx and y and the trigger x and y.. when i had .5 and 1.5. the numbers were exact.. so i will try your changes..

And the server currently not. but i am trying to get the owner to get it p2p i think i can convince him because it will suck if not..

Because of ganis and ext.. one dir gani with no animation is horrible

dragoonvenganc 09-27-2001 09:24 AM

Thanx kjl.. That does work.. but i do not understand.. when i message the value of that it does not match the value of the npc..
O well it works..

but how can i do it for a bigger npc.. there should be a formula.. if some one can fiquere it out.. i am trying but just started and cant seem to get it right..


All times are GMT +2. The time now is 06:28 AM.

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