Jump to content
  • 0

Gives skill when you enter map.


Nipsino

Question


  • Group:  Members
  • Topic Count:  28
  • Topics Per Day:  0.01
  • Content Count:  218
  • Reputation:   16
  • Joined:  01/24/12
  • Last Seen:  

So I was working on an NPC and I was thinking is it possible to give a skill when the player is in a certain map, then once they leave the map, the skills go away. So far this is what I have on the OnPCLoadMapEvent.

- script Skills -1,{
OnPCLoadMapEvent:
if(strcharinfo(3)) = "prontera") {
skill 28,10;
skill 29,10;
skill 34,10;
} else { end; }
}
prontera mapflag loadevent

Map server doesn't show any script errors, however when I enter the map it wouldn't give me the skills.

Link to comment
Share on other sites

2 answers to this question

Recommended Posts


  • Group:  Members
  • Topic Count:  72
  • Topics Per Day:  0.02
  • Content Count:  2997
  • Reputation:   1130
  • Joined:  05/27/12
  • Last Seen:  

if(strcharinfo(3)) = "prontera") {

You should've gotten a mapserver error - there's an extra ")" after strcharinfo. Also, I don't think that deletes the skill when you leave the map - I'd suggest attaching a timer to the player that checks every few seconds if the player is still on the map, and if not, remove the skills and detach the timer.

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  28
  • Topics Per Day:  0.01
  • Content Count:  218
  • Reputation:   16
  • Joined:  01/24/12
  • Last Seen:  

if(strcharinfo(3)) = "prontera") {

You should've gotten a mapserver error - there's an extra ")" after strcharinfo. Also, I don't think that deletes the skill when you leave the map - I'd suggest attaching a timer to the player that checks every few seconds if the player is still on the map, and if not, remove the skills and detach the timer.

Oh sorry about that. That wasn't the actual script, but yeah. It relates to that one. I didn't mean to put the extra ) there. Mmhm, alright. I'll let you know if it's an success. Thanks for the tip, btw. :)

So I used addtoskill 426,10,0; and it worked. Only problem now is too delete the skill when they exit the map. Any ideas?

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