Jump to content
  • 0

PK Area, script not functioning as it should


Question

Posted

Hi.

 

someone of another community (Jabote) made this script, but it doesnt seem functional.  it is suppose to enable killable in a certain cell and that it does but it remains enabled when i leave the circle/cords. Does anyone know how to disable it upon leaving the cords?

 

Thanks in advance :)

 

prontera,202,167,0 script killable -1,8,8,{
OnTouch:
if (!@killable) {
@killable = 1; // Variable for keeping track of the status
atcommand "@killable"; // Don't remember if it needed a parameter, I think it doesn't
addtimer 1000, strnpcinfo(3)+"OnKillable"; // Will check after a second
}
end;
 
OnKillable:
getmapxy(.@map$, .@x, .@y, 0);
if ((.@map$ != prontera || .@x < 202 - 8 || .@x < 202 + 8 || .@y < 167 - 8 || .@y < 167 + 8)) { // Out of the area of effect in Y side
@killable = 0;
atcommand "@killable"; // Don't remember if it needed a parameter, I think it doesn't
}
 
else addtimercount 1000, strnpcinfo(3)+"OnKillable"; // Will check again after a second until player goes out of the square
end;
}

8 answers to this question

Recommended Posts

Posted (edited)

Change:

addtimer 1000, strnpcinfo(3)+"OnKillable"; // Will check after a second

to

 addtimer 1000, strnpcinfo(3)+"::OnKillable"; // Will check after a second

And

else addtimercount 1000, strnpcinfo(3)+"OnKillable"; // Will check again after a second

 

to

else addtimercount 1000, strnpcinfo(3)+"::OnKillable"; // Will check again after a second
Edited by luciar
Posted

Change:

addtimer 1000, strnpcinfo(3)+"OnKillable"; // Will check after a second
to

 addtimer 1000, strnpcinfo(3)+"::OnKillable"; // Will check after a second
And

else addtimercount 1000, strnpcinfo(3)+"OnKillable"; // Will check again after a second
 

to

else addtimercount 1000, strnpcinfo(3)+"::OnKillable"; // Will check again after a second

Hi. Thank you but ive already done this and killable still doesnt disable upon leaving the area. :(

Anything else that could be wrong?

Posted (edited)
if ((.@map$ != prontera || .@x < 202 - 8 || .@x < 202 + 8 || .@y < 167 - 8 || .@y < 167 + 8))

Your operators are all "less than." and you need quotes around the string "prontera"

if ((.@map$ != "prontera" || .@x < 194 || .@x > 210 || .@y < 159 || .@y > 175))

Instead? (I have removed unnecessary calculations from your logic)

Edited by luciar
Posted
if ((.@map$ != prontera || .@x < 202 - 8 || .@x < 202 + 8 || .@y < 167 - 8 || .@y < 167 + 8))

Your operators are all "less than." Shouldn't you have:

if ((.@map$ != prontera || .@x < 194 || .@x > 210 || .@y < 159 || .@y > 175))

Instead? (I have removed unnecessary calculations from your logic)

 

 

Tried this but now the map server says

"script:op_2: invalid data for operator C_NE" >.<

Posted

if ((.@map$ != prontera ||

change to 

 if ((.@map$ != "prontera" ||

 

It still doesn't work sir. :(

This is the script im using now (without tabs):

 

prontera,202,167,0 script killable -1,8,8,{
OnTouch:
if (!@killable) {
@killable = 1; // Variable for keeping track of the status
atcommand "@killable"; // Don't remember if it needed a parameter, I think it doesn't
addtimer 1000, strnpcinfo(3)+"::OnKillable"; // Will check after a second
}
end;
 
OnKillable:
getmapxy(.@map$, .@x, .@y, 0);
if ((.@map$ != "prontera" || .@x < 194 || .@x > 210 || .@y < 159 || .@y > 175)) { // Out of the area of effect in Y side
@killable = 0;
atcommand "@killable"; // Don't remember if it needed a parameter, I think it doesn't
}
 
else addtimercount 1000, strnpcinfo(3)+"::OnKillable";  // Will check again after a second until player goes out of the square
end;
}

 

But the map server says this:

 

post-6697-0-96760000-1416480816_thumb.png

 

Any idea? thanks for your help

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...