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

Scripted npc problems.


adamsharp
 Share

Recommended Posts

hi my npc is scripted with Case 1
Please Tell Me If There Is Any Bugs And If There is please correct them thanks
```
' 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 GivePlayerItem(Index, 1, 25)
            Call PlayerWarp(Index, 2, 9, 7)
Call PlayerMsg(Index, "Welcome To The Mainland.", WHITE)
            Call PlayerMsg(Index, "The People Of Wesa Have Given You 25 Gold As A Gift.", WHITE)
Exit Sub

```
Adam Sharp
Link to comment
Share on other sites

```
' 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 GiveItem(Index, 1, 25)
            Call PlayerWarp(Index, 2, 9, 7)
        Call PlayerMsg(Index, "Welcome To The Mainland.", WHITE)       
            Call PlayerMsg(Index, "The People Of Wesa Have Given You 25 Gold As A Gift.", WHITE)
        Exit Sub
End Sub

```
change it to that. make sure you have inve script installed into ur main

Edit: missed End Sub at the end  :P
Link to comment
Share on other sites

Make sure you got Godlord inventory script.
http://www.touchofdeathforums.com/smf/index.php/topic,28174.0.html

```
' 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 GiveCurrency(Index, 1, 25)
            Call PlayerWarp(Index, 2, 9, 7)
        Call PlayerMsg(Index, "Welcome To The Mainland.", WHITE)       
            Call PlayerMsg(Index, "The People Of Wesa Have Given You 25 Gold As A Gift.", WHITE)
        Exit Sub

```
Link to comment
Share on other sites

```
' 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 GiveCurrency(Index, 1, 25)
            Call PlayerWarp(Index, 2, 9, 7)
        Call PlayerMsg(Index, "Welcome To The Mainland.", WHITE)       
            Call PlayerMsg(Index, "The People Of Wesa Have Given You 25 Gold As A Gift.", WHITE)
        Exit Sub
[color]End Sub[/color]
```
make sure thers a 'End Sub' at the end
Link to comment
Share on other sites

i have…
```
' 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 GiveItem(Index, 1, 25)
            Call PlayerWarp(Index, 2, 9, 7)
        Call PlayerMsg(Index, "Welcome To The Mainland.", WHITE)       
            Call PlayerMsg(Index, "The People Of Wesa Have Given You 25 Gold As A Gift.", WHITE)
        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...