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

Need Help with a script


VitinhooxD
 Share

Recommended Posts

Hi everyone.I 'm making a quest script and i have one problem heres the script:
```
Sub Questing(index)
On Error Resume Next
Dim Status
Dim Name
Dim Questing_msg
Dim  Complete_msg
Dim Needspace
Dim Exp
Dim Need
Dim Needvalue
Dim Give
Dim Givevalue
Dim Level_Msg
Dim Map
Dim ReqLevel

Map = GetPlayerMap(index)
ReqLevel = GetVar("Scripts\mapextras\" & GetPlayerMap(index) & ".ini" , "Level _Requeriment" , "LVL")
Name = GetVar("Scripts\mapextras\" & GetPlayerMap(index) & ".ini" , "MSG" , "Quest_Name")
Call PutVar("Scripts\charextras\" & GetPlayerName(index) & ".ini" , "Status" , ""& map , "NotStarted")
Status = GetVar("Scripts\charextras\" & GetPlayerName(index) & ".ini" , "Quest" , ""& map )

          Select Case Status

              Case NotStarted

Level_Msg = GetVar("Scripts\mapextras\" & GetPlayerMap(index) & ".ini" , "MSG" , " Lvl_Msg ")

    If GetPlayerLevel(Index) >= ReqLevel Then
          Call PlayerMsg(index , "test" , 4)
    Else
          Call CustomMenuClose(index)
          Call CustomMenuShow(index, "ALERT", "\GUI\CUSTOM\Quest.gif", 1)
          Call CustomMenuLabel(index, 20, ""& Level_Msg , 20, 80, 10, 0, 2, 400, 200)

    End If

          End Select

End Sub
```The script should give the message test if the player have more level than the required in the ini file. The required is 1 and i'm level 32.But the script made it contrary.

COuld someone help me?
Thanks.
Link to comment
Share on other sites

I can't see anything wrong with the script…But maybe try switching the lv requirement script around, so replace
```
    If GetPlayerLevel(Index) >= ReqLevel Then
          Call PlayerMsg(index , "test" , 4)
    Else
          Call CustomMenuClose(index)
          Call CustomMenuShow(index, "ALERT", "\GUI\CUSTOM\Quest.gif", 1)
          Call CustomMenuLabel(index, 20, ""& Level_Msg , 20, 80, 10, 0, 2, 400, 200)

    End If

```With
```
    If GetPlayerLevel(Index) < ReqLevel Then
          Call CustomMenuClose(index)
          Call CustomMenuShow(index, "ALERT", "\GUI\CUSTOM\Quest.gif", 1)
          Call CustomMenuLabel(index, 20, ""& Level_Msg , 20, 80, 10, 0, 2, 400, 200)
    End If
    If GetPlayerLevel(Index) >= ReqLevel Then
          Call PlayerMsg(index , "test" , 4)
    End If

```
If that doesn't work try this:
```
    If GetPlayerLevel(Index) < ReqLevel Then
          Call CustomMenuClose(index)
          Call CustomMenuShow(index, "ALERT", "\GUI\CUSTOM\Quest.gif", 1)
          Call CustomMenuLabel(index, 20, ""& Level_Msg , 20, 80, 10, 0, 2, 400, 200)
    Else
          Call PlayerMsg(index , "test" , 4)
    End If

```
I just don't see how it's messing up at all, I don't see a single actual error in it.
Link to comment
Share on other sites

```
Sub Questing(index)
On Error Resume Next
Dim Status
Dim Name
Dim Questing_msg
Dim  Complete_msg
Dim Needspace
Dim Exp
Dim Need
Dim Needvalue
Dim Give
Dim Givevalue
Dim Level_Msg
Dim Map
Dim ReqLevel

Map = GetPlayerMap(index)
ReqLevel = GetVar("Scripts\mapextras\" & GetPlayerMap(index) & ".ini" , "Level _Requeriment" , "LVL")
Name = GetVar("Scripts\mapextras\" & GetPlayerMap(index) & ".ini" , "MSG" , "Quest_Name")
Call PutVar("Scripts\charextras\" & GetPlayerName(index) & ".ini" , "Status" , ""& map , "NotStarted")
Status = GetVar("Scripts\charextras\" & GetPlayerName(index) & ".ini" , "Quest" , ""& map )

          Select Case Status

              Case "NotStarted"

Level_Msg = GetVar("Scripts\mapextras\" & GetPlayerMap(index) & ".ini" , "MSG" , " Lvl_Msg ")

    If GetPlayerLevel(Index) >= ReqLevel Then
          Call PlayerMsg(index , "test" , 4)
    Else
          Call CustomMenuClose(index)
          Call CustomMenuShow(index, "ALERT", "\GUI\CUSTOM\Quest.gif", 1)
          Call CustomMenuLabel(index, 20, ""& Level_Msg , 20, 80, 10, 0, 2, 400, 200)

    End If

          End Select

End Sub
```i was talking about the```
case Not Started
```you need to put quotes around the```
Not Started
```like i did above, in the bigger code box
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...