ell Posted January 30, 2009 Author Share Posted January 30, 2009 I have scripted my own npc, i'm just learning the basics at the moment and I have encountered an error.here is my scriptedNpc```' Executes whenever a scripted NPC does an action.Sub ScriptedNPC(Index, Script) Select Case Script Case 0 Call PlayerMsg(Index, "This scripted NPC has no apparent use.", WHITE) Exit Sub Case 1 Call AdminMsg(Index, "Ghost: Those who stand by yonder tree,", YELLOW) Call AdminMsg(Index, "Ghost: Safe from evil they will be,", YELLOW) Call AdminMsg(Index "Ghost: I now must run, I have to go,", YELLOW) Call AdminMsg(Index "Ghost: Take this cloak that I bestow", YELLOW) 'Call GiveItem(1, 1, 1) Exit Sub Case 2 Call AdminMsg("Welcome to my shope, please, have a look at my goods!", YELLOW) 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```I have the npc's behavior set to scripted and the script to 1 but when I go up to it and press ctr nothing happens. and also is ' comments?thanks in advance ell Link to comment Share on other sites More sharing options...
Southern Posted January 30, 2009 Share Posted January 30, 2009 Make sure your scripts are on, on the server go to control panel and turn scripts on. That should do it. Link to comment Share on other sites More sharing options...
ell Posted January 30, 2009 Author Share Posted January 30, 2009 no luck :( Link to comment Share on other sites More sharing options...
Broken_Paladin Posted January 30, 2009 Share Posted January 30, 2009 Make sure the npc has stats, that could be preventing it from working. Link to comment Share on other sites More sharing options...
Dark_Marine_123 Posted January 30, 2009 Share Posted January 30, 2009 AdminMsg? Make sure you have enough access to see such a message as well, and make sure the NPC is using the correct script Link to comment Share on other sites More sharing options...
ell Posted January 31, 2009 Author Share Posted January 31, 2009 Thanks, but nothing is working and about the adminmsg I am using that temporarily because I dont know how to use plkayermsg, if you could give me a pointer about that aswell, i would deeply apreciate it! thanks agen ell. Link to comment Share on other sites More sharing options...
Dark_Marine_123 Posted January 31, 2009 Share Posted January 31, 2009 Call PlayerMsg(Indexnumber to talk to[Or Index if its the player doing the talking], Message [Dont forget to put it in ""'s if its not reading it elsewhere], Color [1~15 or RED BLUE YELLOW GREEN Etc])Example```Call PlayerMsg(Index, "Bob: Hi Im a scripted NPC, and Riney is a sexy beast", YELLOW)``` Link to comment Share on other sites More sharing options...
ell Posted January 31, 2009 Author Share Posted January 31, 2009 Hi thanks again for all the help ubt i ant understand what index does, i know that its on a load of other things aswell but what does it do?edit: also the npc is wokring now… for some reason :confused: Link to comment Share on other sites More sharing options...
ell Posted January 31, 2009 Author Share Posted January 31, 2009 @ell:> Hi thanks again for all the help ubt i ant understand what index does, i know that its on a load of other things aswell but what does it do?> > edit: also the npc is wokring now… for some reason :confused:grr!! I tried to let the player to make a choice to start a quest or not with player prompt, but no luck so i deleted what i had added but now the npc wont work again, what i wrong!! Link to comment Share on other sites More sharing options...
westin444 Posted January 31, 2009 Share Posted January 31, 2009 what does your code look like now? Link to comment Share on other sites More sharing options...
ell Posted January 31, 2009 Author Share Posted January 31, 2009 ```Sub ScriptedNPC(Index, Script) Select Case Script Case 0 Call PlayerMsg(Index, "This scripted NPC has no apparent use.", WHITE) Exit Sub Case 1 Call PlayerMsg(index, "Those who stand by yonder tree", MAGENTA) Call PlayerMsg(index, "Safe from evil they will be", MAGENTA) Call PlayerMsg(index, "I have to rush, now I must go", MAGENTA) Call PlayerMsg(index, "So take this cloak, I now bestow", MAGENTA) Call GiveItem(index, 1, 1) Call DamageNPC(Index, 1, 99999) 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```well its working now, could someone close this topic? sorry for all the inconvinience i have caused! 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