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

For making a Scripted Npc I do this?


omegas7
 Share

Recommended Posts

I wanted to know if this was the right step for making a scripted Npc:

With the script, for an Npc to tell me a secret if I am level 10 or higher.

```
Dim LEVEL
    Select Case Script
    '--------------------------------
    Case 0
        Call PlayerMsg(index, "I will tell you a secret if you are strong.", 15)
        LEVEL= GetPlayerLevel(index)

        If LEVEL < 10 then
            Call PlayerMsg(index, "too bad, you are not strong enough.", 15)
        Else ' Else: Will run if LEVEL >= 10
            Call Playermsg(index, "You are pretty strong! Oh well, the secret is... I like the pie.", 15)
        End if
    '--------------------------------

```
I put it in case 1 below the Sub ScriptedNpc part in the main.txt script.

Then I got to Npc editor.

I change in the "Behavior" part of it, and I select "Scripted".

Then I select script number 1.

And when I talk to the Npc, the script should work and make the Npc tell me his secret if I have the requirements?

Is this the right way?
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...