Jump to content
Search In
  • More options...
Find results that contain...
Find results in...

More scripted NPC problems!


Kip336
 Share

Recommended Posts

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 Select
End 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

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...