Elyn Posted July 31, 2013 Group: Members Topic Count: 2 Topics Per Day: 0.00 Content Count: 2 Reputation: 0 Joined: 07/27/13 Last Seen: July 31, 2013 Share Posted July 31, 2013 So i want to make it so that if a player is carrying a specific item, in this case an I.D. card, then specific npc's won't initiate dialogue with that character in the trigger area. If they aren't then diologue is started. How would i do this? Quote Link to comment Share on other sites More sharing options...
Hiryu Imajin Posted July 31, 2013 Group: Members Topic Count: 5 Topics Per Day: 0.00 Content Count: 58 Reputation: 4 Joined: 07/10/13 Last Seen: December 15, 2018 Share Posted July 31, 2013 (edited) Let me get it though, sorry. Just to elaborate, so for example id number 4359 (Assassin Cross Card) Will it be checked if it was equipped or will it be checked if its in the inventory? This is possible but the structure of the complete script i'm not sure of as I am just starting to do scripting but don't worry i'm just trying to make things clear. I would also like to share my thoughts about this once I got the point clear I might be able to do the script and maybe someone would help us as well develop it. Thanks! Edited July 31, 2013 by redhotzip Quote Link to comment Share on other sites More sharing options...
GmOcean Posted July 31, 2013 Group: Members Topic Count: 31 Topics Per Day: 0.01 Content Count: 666 Reputation: 93 Joined: 04/27/12 Last Seen: August 17, 2015 Share Posted July 31, 2013 Quite simple really, first off, just create an NPC that i triggered when a person walks within range of it. <map name>,<x>,<y>,<facing>%TAB%script%TAB%<NPC Name>%TAB%<sprite id>,<triggerX>,<triggerY>,{<code>} Then we edit the code to filter out when to activate. Whether it be when someone clicks on it or comes in range. In this case I'll do both, so that clicking an NPC will result in a different dialogue then when within range. <map name>,<x>,<y>,<facing>%TAB%script%TAB%<NPC Name>%TAB%<sprite id>,<triggerX>,<triggerY>,{ mes "NPC Name"; mes "This is what will appear when someone clicks on me."; close; OnTouch: //This is triggered when a player walks in the trigger range of the NPC. if ( countitem(<item id>) ) //This will check to see if the player has the item in his/her inventory. {end;} // If they do, it will end the script resulting in nothing happening. Otherwise it will continue down the script and trigger the dialogue. mes "NPC Name"; mes "This is what will appear when someone walks within range of me, and does not have the item: "+ getitemname(<item id>) +" in their inventory."; close;} And that is all that needs to be done. Hope this solves your problem. 2 Quote Link to comment Share on other sites More sharing options...
Question
Elyn
So i want to make it so that if a player is carrying a specific item, in this case an I.D. card, then specific npc's won't initiate dialogue with that character in the trigger area. If they aren't then diologue is started. How would i do this?
Link to comment
Share on other sites
2 answers to this question
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.