Sakis Posted April 17, 2009 Author Share Posted April 17, 2009 Okay my script is messing up right now and I need some help on this one:```' Executes whenever a scripted NPC does an action.Sub ScriptedNPC(index, Script)On Error Resume nextDim statusDim start_msgDim questing_msgDim end_msgDim completed_msgDim has_neededDim need_countDim give_countDim slotDim countDim foundDim numberDim durabilityDim valueDim experienceDim nameDim reqitemDim rewitemDim reqvalDim rewvalDim pmpm = GetPlayerMap(index)reqitem = GetVar("Quests\Basic.ini", pm, "reqitemnum")reqval = GetVar("Quests\Basic.ini", pm, "reqitemval")rewitem = GetVar("Quests\Basic.ini", pm, "rewitemnum")rewval = GetVar("Quests\Basic.ini", pm, "rewitemval")Select Case Script Case 0 If CheckInventoryForItem(index, reqitem) = true Then Call TakeItem(index, reqitem, reqval) Call GiveItem(index, rewitem, rewval) Call PlayerMsg(index, "Congrats you have completed your quest!", 4) Else Call PlayerMsg(index, "You don't have the requested item, the Slime Goo.", 4) End IfEnd Select End SubSub CheckInventoryForItem(index, reqitem)CheckInventoryForItem = falseSLOT = 1Do While SLOT < 24If GetPlayerInvItemNum(index, SLOT) = item ThenCheckInventoryForItem = trueSLOT = 24End IfSLOT = SLOT+1LoopEnd Sub``````Sub TakeItem(index, item, value)If value = "all" ThenSLOT = 1Do While SLOT < 24If GetPlayerInvItemNum(index, SLOT) = item ThenCall SetPlayerInvItemNum(index, SLOT, 0)Call SetPlayerInvItemValue(index, SLOT, 0)Call SendInventoryUpdate(index, SLOT)SLOT = 24End IfSLOT = SLOT+1LoopEnd SubElseSLOT = 1Do While SLOT < 24If GetPlayerInvItemNum(index, SLOT) = item ThenCall SetPlayerInvItemNum(index, SLOT, 0)Call SetPlayerInvItemValue(index, SLOT, GetPlayerInvItemValue(index, SLOT) - value)Call SendInventoryUpdate(index, SLOT)SLOT = 24End IfSLOT = SLOT+1LoopEnd SubEnd IfSub GiveItem(index, item, value)SLOT = 1Do While SLOT < 24If GetPlayerInvItemNum(index, SLOT) = 0 ThenCall SetPlayerInvItemNum(index, SLOT, item)Call SetPlayerInvItemValue(index, SLOT, value)Call SendInventoryUpdate(index, SLOT)SLOT = 24End IfSLOT = SLOT+1LoopEnd Sub```it keeps having the npc saying the quest is complete but it don't take the item and i don't receive the reward either Link to comment Share on other sites More sharing options...
Admiral Refuge Posted April 17, 2009 Share Posted April 17, 2009 The inefficiency… IT BURNS!I haven't tried picking through the syntax, it does look correct, but dude, almost all of those variables being declared aren't even being used or even initialized!PS: You do have a "Quests" folder and inis in your server folder, right? Link to comment Share on other sites More sharing options...
Sakis Posted April 17, 2009 Author Share Posted April 17, 2009 @Ã…ÃÂüiÑÂôζ:> PS: You do have a "Quests" folder and inis in your server folder, right?yeah i got that and i followed the rule that Godlord put up in the tutorial to make this quest script but for some reason it is not at all working for me…its like all he ever says is quest is complete and i got all the things the way it should be but it is not working at all...is their something wrong with it because it is really annoying that it always happens 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