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

What's wrong with this code?


Squiddle
 Share

Recommended Posts

Does anyone see an error with this code?

```
sub quest11(index)

If GetPlayerNecklaceSlot(index) = 0 Then
Call CustomMenuShow(Index, "Forest Quests", "\GUI\CUSTOM\Forest\ForestQuests\Stray Cat Quest\StrayCat1.gif", 1)
Else
If GetPlayerInvItemNum(index, GetPlayerNecklaceSlot(index)) = 401 Then
Call CustomMenuShow(Index, "Forest Quests", "\GUI\CUSTOM\Forest\ForestQuests\Stray Cat Quest\StrayCat2.gif", 1)
Call PutVar("Scripts\charextras\" & GetPlayerName(Index) & "AncientForest.ini", "QUESTS", "Flag1", 1)
Else
Call CustomMenuShow(Index, "Forest Quests", "\GUI\CUSTOM\Forest\ForestQuests\Stray Cat Quest\StrayCat1.gif", 1)
End If
Else
    Call CustomMenuShow(Index, "Forest Quests", "\GUI\CUSTOM\Forest\ForestQuests\Stray Cat Quest\StrayCat1.gif", 1)
End If

End Sub
```
I can't figure out why it's not working :(
Link to comment
Share on other sites

use this:

```
Sub ScriptedNPC(Index, Script)
  Select Case Script
      Case 0 
Call CustomMenuClose(Index)
If GetVar("Scripts\charextras\" & GetPlayerName(Index) & "AncientForest.ini", "QUESTS", "Flag1") = "0" Then
Call quest11(index)
ElseIf GetVar("Scripts\charextras\" & GetPlayerName(Index) & "AncientForest.ini", "QUESTS", "Flag1") = "1" Then
Call quest12(index)
ElseIf GetVar("Scripts\charextras\" & GetPlayerName(Index) & "AncientForest.ini", "QUESTS", "Flag1") = "2" Then
Call quest13(index)
Else
Call quest11(index)
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

```
lemme know what happens
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...