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

My quest script bugged


lucifer1101
 Share

Recommended Posts

can someone please help me debug my quest script.

```
Sub quest1(index)
If GetVar("Scripts\charextras\" & GetPlayerName(index) & ".ini", "Quests", "Quest1") = 1 Then
Call PlayerMsg(index, "Teacher: What are you still doing here, go run!", 4)
End If
End Sub
Else
Call PlayerMsg(index, "Teacher: " & GetPlayerName(index) & " Get out of here now!", 4)
Call PlayerMsg(index, "Teacher: There are Antell Sentries searching the town for young people around your age, you must run!", 4)
Call PlayerMsg(index, "Teacher: Take these items and go to the teleport orb and touch it.", 4)
Call PlayerMsg(index, "Teacher: Go run!", 4)
Call giveitem(index, 2, 50)
Call giveitem(index, 3, 50)
Call givecurrency(index, 1, 20)
Call PutVar("Scripts\charextras\" & GetPlayerName(index) & ".ini", "Quests", "Quest1", 1)
Exit Sub

```
I had it working before i put the getvar stuff in, i just dont know how to properly close the script.
Link to comment
Share on other sites

```
Sub quest1(index)
If GetVar("Scripts\charextras\" & GetPlayerName(index) & ".ini", "Quests", "Quest1") = 1 Then
Call PlayerMsg(index, "Teacher: What are you still doing here, go run!", 4)
Exit Sub
Else
Call PlayerMsg(index, "Teacher: " & GetPlayerName(index) & " Get out of here now!", 4)
Call PlayerMsg(index, "Teacher: There are Antell Sentries searching the town for young people around your age, you must run!", 4)
Call PlayerMsg(index, "Teacher: Take these items and go to the teleport orb and touch it.", 4)
Call PlayerMsg(index, "Teacher: Go run!", 4)
Call giveitem(index, 2, 50)
Call giveitem(index, 3, 50)
Call givecurrency(index, 1, 20)
Call PutVar("Scripts\charextras\" & GetPlayerName(index) & ".ini", "Quests", "Quest1", 1)
End If
End Sub

```If, Then, Else, End If
Link to comment
Share on other sites

Check if you have the folder 'Charextras'.. maybe you deleted it (and the .INI of course).

Note: to run the script, you will NEED to have the values on your .ini so easier way to do it if you have deleted it:
add this on sub join:
```
If GetVar("Scripts\charextras\" & GetPlayerName(index) & ".ini", "Quests", "Quest1") <> 1 then
Call PutVar("Scripts\charextras\" & GetPlayerName(index) & ".ini", "Quests", "Quest1", 0)
End If

```
Hope this helps,
From: Zananok
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...