Jump to content
  • 0

PK Area, script not functioning as it should


HristDead

Question


  • Group:  Members
  • Topic Count:  66
  • Topics Per Day:  0.02
  • Content Count:  167
  • Reputation:   2
  • Joined:  08/01/12
  • Last Seen:  

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;
}
Link to comment
Share on other sites

8 answers to this question

Recommended Posts


  • Group:  Members
  • Topic Count:  5
  • Topics Per Day:  0.00
  • Content Count:  177
  • Reputation:   21
  • Joined:  01/31/12
  • Last Seen:  

Change your event label to something other than the NPC's name

  • Upvote 1
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  5
  • Topics Per Day:  0.00
  • Content Count:  177
  • Reputation:   21
  • Joined:  01/31/12
  • Last Seen:  

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
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  66
  • Topics Per Day:  0.02
  • Content Count:  167
  • Reputation:   2
  • Joined:  08/01/12
  • Last Seen:  

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?

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  5
  • Topics Per Day:  0.00
  • Content Count:  177
  • Reputation:   21
  • Joined:  01/31/12
  • Last Seen:  

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
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  66
  • Topics Per Day:  0.02
  • Content Count:  167
  • Reputation:   2
  • Joined:  08/01/12
  • Last Seen:  

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" >.<

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  5
  • Topics Per Day:  0.00
  • Content Count:  177
  • Reputation:   21
  • Joined:  01/31/12
  • Last Seen:  

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

 

change to 

 

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

 
 

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  66
  • Topics Per Day:  0.02
  • Content Count:  167
  • Reputation:   2
  • Joined:  08/01/12
  • Last Seen:  

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

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  66
  • Topics Per Day:  0.02
  • Content Count:  167
  • Reputation:   2
  • Joined:  08/01/12
  • Last Seen:  

Change your event label to something other than the NPC's name

 

It works now thanks!! :)

Edited by HristDead
Link to comment
Share on other sites

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.

×
×
  • Create New...