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

Where do I put scripts for NPCs, Items, etc.?


Orechalcos
 Share

Recommended Posts

thanks

EDIT

```
Sub ScriptedNPC(Index, Script)
Select Case Script
Case 0
Dim Exp
                Dim x
                Dim y
                Dim z
                Dim a

                Exp = GetplayerExp(index)

                x = 10
                y = 20
                z = 30
                a = 5          
                  If GetPlayerLevel(Index) <=5
                            Call PlayerMsg(index, "Hi! I'm Trainer Lar, and I'm here to teach melee combat! It's quite simple! Go out and use the CTRL key to attack some rabbits! Bring me back five rabbit feet.", 12)
                            If CanTake(Index, 2, 5) = false Then
                                Call PlayerMsg(Index, "You do not currently have the rabbit feet, please return when you do.", 12)
                            Else
                                Call TakeItem(index, 2, 5)
                                Call GiveItem(index, 1, 10)
                                Call PlayerMsg(index, "Now that you know the basics of combat, take this gold and go to Trainer Kude there, he'll tell you what to do next.", 12)
                                Call SetPlayerExp(index, Exp + x)
                                Call PlayerMsg(Index, "+10 EXP", 15)
                Call SendStats(index)
                            End If
                  Else
                    Call PlayerMsg(index, "Sorry, but this tutorial is for new adventurers.", 12)
                  End If
                  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
```
This is my Scripted NPC sub in Main.txt, but it won't work… I put in my quest script, then went to NPC Editor and chose scripted npc on the tutor I made. I then chose script 0 went to the tutor and tried to talk to him, but nothing happened... help?
Link to comment
Share on other sites

> Sub ScriptedNPC(Index, Script)
> Select Case Script
> Case 0
> Dim Exp
>                 Dim x
>                 Dim y
>                 Dim z
>                 Dim a
>
>                 Exp = GetplayerExp(index)
>
>                 x = 10
>                 y = 20
>                 z = 30
>                 a = 5          
>                   If GetPlayerLevel(Index) <=5 Then
>                             Call PlayerMsg(index, "Hi! I'm Trainer Lar, and I'm here to teach melee combat! It's quite simple! Go out and use the CTRL key to attack some rabbits! Bring me back five rabbit feet.", 12)
>                             If CanTake(Index, 2, 5) = false Then
>                                 Call PlayerMsg(Index, "You do not currently have the rabbit feet, please return when you do.", 12)
>                             Else
>                                 Call TakeItem(index, 2, 5)
>                                 Call GiveItem(index, 1, 10)
>                                 Call PlayerMsg(index, "Now that you know the basics of combat, take this gold and go to Trainer Kude there, he'll tell you what to do next.", 12)
>                                 Call SetPlayerExp(index, Exp + x)
>                                 Call PlayerMsg(Index, "+10 EXP", 15)
>                 Call SendStats(index)
>                             End If
>                   Else
>                     Call PlayerMsg(index, "Sorry, but this tutorial is for new adventurers.", 12)
>                   End If
>                   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
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...