Kip336 Posted July 28, 2009 Author Share Posted July 28, 2009 Well..my first post here *ducksdontbashme*so, After editing the main.txt for a couple of days, I went on to start on Custom NPC's. Something told me that was the most easy way to learn the scripting.I made an NPC in game, and set it to script #1\. In the main exe, I have this:```' Executes whenever a scripted NPC does an action.Sub ScriptedNPC(Index, Script) Select Case Script Case 0 Call PlayerMsg(Index, "NPC Script 1.", YELLOW) Exit Sub Case 1 Call PlayerMsg(Index, "NPC Script 2.", RED) 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```Nothing fancy, no real edits. I figured, that, by using 2 codes, I could establish how the scripting world (Would script 0, look at case 0, script 1 - case 1 etc) Even color coded it for myself.Reloaded the script, placed the NPC, walked up, pressed CTRL…..and..nothing.Same results on pretty much every button on mykeyboard, except for F1\. All to no avail.Either way - I'm stuck with an Lazy NPC, or with myself being to annoyed to find the mistake in my code. What am I doing wrong?One tad big that might help - I am not the server myself, I am merely a scripter. The server did upload the scripts, and used the /refresh command. Server didnt go out in the meantime, if that helps.Thanks in advance :) Link to comment Share on other sites More sharing options...
Admiral Refuge Posted July 28, 2009 Share Posted July 28, 2009 Your Case Else is messed up. You can't have linebreaks like that (unless you use "_"; but that's another story).Should have been:``` Case Else Call PlayerMsg(Index, "No NPC script found. Please contact an admin to solve this problem.", WHITE)``` Link to comment Share on other sites More sharing options...
Kip336 Posted July 29, 2009 Author Share Posted July 29, 2009 Let me blame myself for overlooking that, and notepad for doing it. I'll be downloading that IDE editor, thanks! 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