cody4camp Posted August 18, 2009 Author Share Posted August 18, 2009 I need to be able to open a shop by pressing a button near an npc, for example ctrl. how would i do it? Link to comment Share on other sites More sharing options...
Kimimaru Posted August 18, 2009 Share Posted August 18, 2009 I believe you would just set the NPC to a shopkeeper and then specify which shop number you want it to open using the NPC editor in-game. Link to comment Share on other sites More sharing options...
Admiral Refuge Posted August 18, 2009 Share Posted August 18, 2009 Shopkeeper doesn't work.Just have a scripted npc; here is the script:Case X Call GoShopping(Index, ShopNumber)Replace "X" with the case number, and "ShopNumber" with the shop's number. Link to comment Share on other sites More sharing options...
cody4camp Posted August 18, 2009 Author Share Posted August 18, 2009 thanks alot Admiral Refuge, credit will be given ;)also, what will make it open? Link to comment Share on other sites More sharing options...
Godlord Posted August 18, 2009 Share Posted August 18, 2009 @cody4camp:> thanks alot Admiral Refuge, credit will be given ;)> > also, what will make it open?If you're refering to the scripting then go to your Server folder, in the Script folder open Main.txt with Notepad.Regards, Godlord. Link to comment Share on other sites More sharing options...
cody4camp Posted August 18, 2009 Author Share Posted August 18, 2009 i put the script in, and set my npc to scripted, but it wont do anything, ive tried clicking the npc, pressing ctrl on it, but nothing. Link to comment Share on other sites More sharing options...
Godlord Posted August 18, 2009 Share Posted August 18, 2009 Tried /testscripts yet in the chatbox?Regards, Godlord. Link to comment Share on other sites More sharing options...
cody4camp Posted August 18, 2009 Author Share Posted August 18, 2009 says scripts are working properly. ive reloaded them and all. i have it as case 1 under scripted npc, and the npc is scripted and the script is set to 1. Link to comment Share on other sites More sharing options...
cody4camp Posted August 18, 2009 Author Share Posted August 18, 2009 i just need to know what sparks the action of a scripted npc? ctrl key doesnt do it.```' Executes whenever a scripted NPC does an action.Sub ScriptedNPC(Index, Script) Select Case Script Case 0 Call PlayerMsg(Index, "Welcome to my store!.", WHITE) Call GoShopping(Index, 1) Exit Sub Case Else Call PlayerMsg(Index, "No NPC script found. Please contact an admin to solve this problem.", WHITE) Exit Sub End SelectEnd Sub``` Link to comment Share on other sites More sharing options...
Gwen Posted August 18, 2009 Share Posted August 18, 2009 what if you make a scripted or shop tile in front of the npc. I forget which one you have to do. Link to comment Share on other sites More sharing options...
cody4camp Posted August 18, 2009 Author Share Posted August 18, 2009 the problem is i cannot find out which key activates the scripted npc Link to comment Share on other sites More sharing options...
Gwen Posted August 18, 2009 Share Posted August 18, 2009 if you use a scripted tile you dont need a key… you just step on the tile. Link to comment Share on other sites More sharing options...
Agoraphobic Posted August 18, 2009 Share Posted August 18, 2009 Your code is fine.I. You need to set the npc to scripted npc script 0.II. Make sure the npc has atleast 1 in every stat.III. Create a currency.IV. Use Shop tab to make a shop in 1 slot and select what he sells.Walk up to him and press ctrl and it works (tested). Link to comment Share on other sites More sharing options...
cody4camp Posted August 18, 2009 Author Share Posted August 18, 2009 still isnt working for me, walking up and pressing ctrl does nothing :icon_alabanza:EDIT: i respawned map, that worked.SOLVED! credits: admiral refuge, Agoraphobic. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now