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

Proofread this quest pls


Diskmaster
 Share

Recommended Posts

I actually copy and pasted a previous quest I did (changing the variables and speech of corse) but it still won't work!! (it also causes errors to all of my other scripted NPCs) and here it is:
```
Case 9
If GetVar("Chest\" & GetPlayerName(index) & ".ini", "Chest", "Chest18") = "Have" Then
  Call playermsg(index, "Thank You, you have done a favor to the community and everyone around you!", 14)
  Exit Sub
  End if 
If GetFreeSlots(Index) = 0 Then
  Call PlayerMsg(Index, "If you have space in your inventory, only then will wisdom be granted to thee", RED)
  Exit Sub
End if
If CanTake(Index, 49, 10) & GetVar("Chest\" & GetPlayerName(index) & ".ini", "Chest", "Chest17") = "Have" Then
  Call GiveItem(Index, 289, 0)
  Call playermsg(index, "So, you got all of them? Well, here is your prize!", 14)
  Call playermsg(index, "here is your shield aaaaaand:", 14)
  Call playermsg(index, "QUEST COMPLETE, you gained 50 Exp!", 2)
  Call SetPlayerExp(Index, GetPlayerExp(Index) + 50)
  Call Spellanim(221, GetPlayerMap(index), GetPlayerX(index), GetPlayerY(index))
Call PutVar("Chest\" & GetPlayerName(index) & ".ini", "Chest", "Chest18", "Have") 
  Exit Sub
End if
If GetVar("Chest\" & GetPlayerName(index) & ".ini", "Chest", "Chest17") = "Have" Then
Call playermsg(index, "Could you do this for me, Please!!", 14)
Else
Call playermsg(index, "Well, Good mornin young one!", 14)
Call playermsg(index, "Hows would you like to do me and your community a little favor?", 14)
Call playermsg(index, "All you have to do is kill 10 slimes and bring back 10 slime juices as proof", 14)
Call playermsg(index, "If you do this, I will reward you with a special shield made especially for newbies!", 14)
Call playermsg(index, "QUEST STARTED: A Sticky Situation", 10)
Call PutVar("Chest\" & GetPlayerName(index) & ".ini", "Chest", "Chest17", "Have")
  End if
Exit sub

```
Link to comment
Share on other sites

looking over it again, i saw something that MIGHT have made it not work, probably not, but try this:```
Case 9
If GetVar("Chest\" & GetPlayerName(index) & ".ini", "Chest", "Chest18") = "Have" Then
Call playermsg(index, "Thank You, you have done a favor to the community and everyone around you!", 14)
Exit Sub
  End If 

If GetFreeSlots(Index) = 0 Then
  Call PlayerMsg(Index, "If you have space in your inventory, only then will wisdom be granted to thee", RED)
  Exit Sub
End If

If CanTake(Index, 49, 10) And GetVar("Chest\" & GetPlayerName(index) & ".ini", "Chest", "Chest17") = "Have" Then
Call GiveItem(Index, 289, 0)
Call playermsg(index, "So, you got all of them? Well, here is your prize!", 14)
  Call playermsg(index, "here is your shield aaaaaand:", 14)
  Call playermsg(index, "QUEST COMPLETE, you gained 50 Exp!", 2)
  Call SetPlayerExp(Index, GetPlayerExp(Index) + 50)
  Call Spellanim(221, GetPlayerMap(index), GetPlayerX(index), GetPlayerY(index))
Call PutVar("Chest\" & GetPlayerName(index) & ".ini", "Chest", "Chest18", "Have") 
Exit Sub
End If

If GetVar("Chest\" & GetPlayerName(index) & ".ini", "Chest", "Chest17") = "Have" Then
Call playermsg(index, "Could you do this for me, Please!!", 14)
Else
Call playermsg(index, "Well, Good mornin young one!", 14)
Call playermsg(index, "Hows would you like to do me and your community a little favor?", 14)
Call playermsg(index, "All you have to do is kill 10 slimes and bring back 10 slime juices as proof", 14)
Call playermsg(index, "If you do this, I will reward you with a special shield made especially for newbies!", 14)
Call playermsg(index, "QUEST STARTED: A Sticky Situation", 10)
Call PutVar("Chest\" & GetPlayerName(index) & ".ini", "Chest", "Chest17", "Have")     
  End If
Exit Sub
```
Link to comment
Share on other sites

End Select…
I don't think that is what is wrong... OH W8, am I allowed to do this:
```
if GetVar("Chest\" & GetPlayerName(index) & ".ini", "Chest", "Chest17") = "Have" Then
Call playermsg(index, "Could you do this for me, Please!!", 14)
Else

```Can I put an else in there if I already had exit subs and end ifs.?.

EDIT: Nope, still doesn't work
EDIT OF EDIT: When I take it out, all the scripts work again, which could only mean one thing… it is an error in the origional script......
Link to comment
Share on other sites

Ah well, after random switching around of different variables (mainly exit subs and end ifs) I got it to work! (I think it actually did have to do with my script above it, it had an extra end sub so, the above script worked, but no other script afterward worked thanks tho :azn:
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...