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

Can you find my mistake?


Nubbs
 Share

Recommended Posts

okay so I'm using IrunoHatake's Quest Script found here(http://www.touchofdeathforums.com/smf/index.php?topic=29991.msg268225#msg268225) as a base for these quests…so what happens is Case "0" works 100%, but when i use Case "1"  it resets my Exp to "0" after completing the quest and i can't figure out what im doing wrong

```
' Executes whenever a scripted NPC does an action.
Sub ScriptedNPC(Index, Script)
Select Case Script
Case 0
Dim Exp
Dim x
Dim y
Dim z
Dim a

Exp = GetplayerExp(index)

x = 5
y = 20
z = 30
a = 5

  If GetPlayerClass(index) = 1 Then
  If GetPlayerLevel(index) > 10 Then
    Call PlayerMsg(index, "player message ", 1)
      If CanTake(Index, 12, 1) = false Then
    Call PlayerMsg(index, "player message...", 9)
Else
    Call TakeItem(index, 12, 1)
    Call PlayerMsg(index, "player message", 2)
    Call SetplayerExp(index, Exp + a)
                    Call PlayerMsg(index, "You gained 5 experience!", 10)
Call SendStats(index)
                End If
  Else
    Call PlayerMsg(index, "player message", 12)         
              End If
  Else

      Call PlayerMsg(index, "player message'", 12)
  End If

End Sub 
  Case 1

  If GetPlayerClass(index) = 0 Then
  If GetPlayerLevel(index) < 10 Then
    Call PlayerMsg(index, "Iplayer message", 1)
      If CanTake(Index, 12, 1) = false Then
    Call PlayerMsg(index, "playermessage...", 9)
Else
    Call TakeItem(index, 12, 1)
    Call PlayerMsg(index, "player message", 2)
    Call SetplayerExp(index, Exp + 5))
                    Call PlayerMsg(index, "You gained 5 experience!", 10)
Call SendStats(index)
                End If
  Else
    Call PlayerMsg(index, "player message", 12)         
              End If
  Else

      Call PlayerMsg(index, "player message'", 12)
  End If
  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...