Diskmaster Posted July 18, 2009 Author Share Posted July 18, 2009 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 9If 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 SubEnd ifIf 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 SubEnd if If GetVar("Chest\" & GetPlayerName(index) & ".ini", "Chest", "Chest17") = "Have" Then Call playermsg(index, "Could you do this for me, Please!!", 14) ElseCall 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 More sharing options...
Bobosk Posted July 18, 2009 Share Posted July 18, 2009 I don't see anything wrong with it, perhaps you could post the rest of your scripted npcs, as there might be a problem in one of them, or even one of the subs any of your scripted npcs sub calls upon Link to comment Share on other sites More sharing options...
Mr. Bob Firefarter Posted July 18, 2009 Share Posted July 18, 2009 What type of quest is it, exactly? Link to comment Share on other sites More sharing options...
Diskmaster Posted July 18, 2009 Author Share Posted July 18, 2009 A Take Item Give Item quest, but u can't give the item until u start the quest Link to comment Share on other sites More sharing options...
Bobosk Posted July 18, 2009 Share Posted July 18, 2009 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 More sharing options...
Diskmaster Posted July 18, 2009 Author Share Posted July 18, 2009 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 workEDIT 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 More sharing options...
Bobosk Posted July 18, 2009 Share Posted July 18, 2009 Sorry, the end select and all that wasn't it.. it was something else(The & in between the If Checks…) i just had to put all that crap in for my debugger :P i'll edit it xD Link to comment Share on other sites More sharing options...
Diskmaster Posted July 18, 2009 Author Share Posted July 18, 2009 No no, I found what u did and changed the end select and case stuff and it STILL didn't work… I still don't know what could be wrong with it Link to comment Share on other sites More sharing options...
Bobosk Posted July 18, 2009 Share Posted July 18, 2009 Well, like i said, if you would just post your scripted npcs sub(in whole) and any subs that it calls(seperate code tags) then we could possibly help figure out the issues Link to comment Share on other sites More sharing options...
Diskmaster Posted July 19, 2009 Author Share Posted July 19, 2009 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 More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now