Dastyruck Posted July 3, 2009 Author Share Posted July 3, 2009 K, so I am making my own crafting system for my game and this is the Craft sub.> '********************************> Sub Craft(index, Item, Matone, Valone, Mattwo, Valtwo, Matthree, Valthree, Matfour, Valfour, Matfive, Valfive, Matsix, Valsix, Matseven, Valseven)> '********************************> Call PlayerMsg(Index, "4", RED)> Dim matnum> Dim slot> Dim has> Dim need> Dim mathas> > matnum = 0> mathas = 0> > If Matone = 0 Then> Else> matnum += 1> End If> If Mattwo = 0 Then> Else> matnum += 1> End If> If Matthree = 0 Then> Else> matnum += 1> End If> If Matfour = 0 Then> Else> matnum += 1> End If> If Matfive = 0 Then> Else> matnum += 1> End If> If Matsix = 0 Then> Else> matnum += 1> End If> If Matseven = 0 Then> Else> matnum += 1> End If> > If matnum >= 1 Then> slot=1> has = 0> need = 1 > > Do While slot < 25 > If Int(getplayerinvitemnum(index,slot))=Int(Matone) Then> If Int(getplayerinvitemval(index,slot))=Int(Valone) Then> slot=25> has = 1> End If > End If > slot=slot+1> Loop> If Int(has) <> Int(need) Then> Call PlayerMsg(Index, "You do not have the proper items or proper amount of items.", RED)> Exit Sub> Else> mathas += 1> > End If> End If> > If matnum >= 2 Then> slot=1> has = 0> need = 1 > > Do While slot < 25 > If Int(getplayerinvitemnum(index,slot))=Int(Mattwo) Then> If Int(getplayerinvitemval(index,slot))=Int(Valtwo) Then> slot=25> has = 1> End If > End If > slot=slot+1> Loop> If Int(has) <> Int(need) Then> Call PlayerMsg(Index, "You do not have the proper items or proper amount of items.", RED)> Exit Sub> Else> mathas += 1> > End If> End If> > If matnum >= 3 Then> slot=1> has = 0> need = 1 > > Do While slot < 25 > If Int(getplayerinvitemnum(index,slot))=Int(Matthree) Then> If Int(getplayerinvitemval(index,slot))=Int(Valthree) Then> slot=25> has = 1> End If > End If > slot=slot+1> Loop> If Int(has) <> Int(need) Then> Call PlayerMsg(Index, "You do not have the proper items or proper amount of items.", RED)> Exit Sub> Else> mathas += 1> > End If> End If> > If matnum >= 4 Then> slot=1> has = 0> need = 1 > > Do While slot < 25 > If Int(getplayerinvitemnum(index,slot))=Int(Matfour) Then> If Int(getplayerinvitemval(index,slot))=Int(Valfour) Then> slot=25> has = 1> End If > End If > slot=slot+1> Loop> If Int(has) <> Int(need) Then> Call PlayerMsg(Index, "You do not have the proper items or proper amount of items.", RED)> Exit Sub> Else> mathas += 1> > End If> End If> > If matnum >= 5 Then> slot=1> has = 0> need = 1 > > Do While slot < 25 > If Int(getplayerinvitemnum(index,slot))=Int(Matfive) Then> If Int(getplayerinvitemval(index,slot))=Int(Valfive) Then> slot=25> has = 1> End If > End If > slot=slot+1> Loop> If Int(has) <> Int(need) Then> Call PlayerMsg(Index, "You do not have the proper items or proper amount of items.", RED)> Exit Sub> Else> mathas += 1> > End If> End If> > If matnum >= 6 Then> slot=1> has = 0> need = 1 > > Do While slot < 25 > If Int(getplayerinvitemnum(index,slot))=Int(Matsix) Then> If Int(getplayerinvitemval(index,slot))=Int(Valsix) Then> slot=25> has = 1> End If > End If > slot=slot+1> Loop> If Int(has) <> Int(need) Then> Call PlayerMsg(Index, "You do not have the proper items or proper amount of items.", RED)> Exit Sub> Else> mathas += 1> > End If> End If> > If matnum >= 7 Then> slot=1> has = 0> need = 1 > > Do While slot < 25 > If Int(getplayerinvitemnum(index,slot))=Int(Matseven) Then> If Int(getplayerinvitemval(index,slot))=Int(Valseven) Then> slot=25> has = 1> End If > End If > slot=slot+1> Loop> If Int(has) <> Int(need) Then> Call PlayerMsg(Index, "You do not have the proper items or proper amount of items.", RED)> Exit Sub> Else> mathas += 1> End If> End If> > If mathas = matneed Then> If mathas >= 1 Then> Call quest_Take_Item(index, Matone, Valone)> End If> If mathas >= 2 Then> Call quest_Take_Item(index, Mattwo, Valtwo)> End If> If mathas >= 3 Then> Call quest_Take_Item(index, Matthree, Valthree)> End If> If mathas >= 4 Then> Call quest_Take_Item(index, Matfour, Valfour)> End If> If mathas >= 5 Then> Call quest_Take_Item(index, Matfive, Valfive)> End If> If mathas >= 6 Then> Call quest_Take_Item(index, Matsix, Valsix)> End If> If mathas >= 7 Then> Call quest_Take_Item(index, Matseven, Valseven)> End If> Call quest_give_item(index, Item, 1)> End If> > End SubThis is the Call that initiates it, So far it gets thorugh PlayerMsg 1,2, and 3 but is halting at 4, couldnt find a problem and need help.> '********************************> Sub MenuScripts(Index, Clicked_Index, Menu_Type)> '********************************> Dim MenuTitle> Dim FieldMessage> > MenuTitle = getplayermenuclicktitle(Index)> FieldMessage = getplayermenuclickmsg(Index)> > Select Case Menu_Type> Case 1> > > Case 2> > Case 3> Call PlayerMsg(Index, "1", RED)> Call PlayerMsg(Index, "2", RED)> If Clicked_Index = 1 Then> Call PlayerMsg(Index, "3", RED)> Call Craft(Index, 3, 8, 2, 45, 3, 44, 1, 46, 1, 0,0,0,0,0,0) > End If> End Select> End SubThanks in advance. Link to comment Share on other sites More sharing options...
balliztik1 Posted July 3, 2009 Share Posted July 3, 2009 It's because you're using "mathas += 1" and "matnum += 1". While that works in VBScript and is syntactically correct, VB cannot read it when it's read through to the server. Link to comment Share on other sites More sharing options...
Dastyruck Posted July 3, 2009 Author Share Posted July 3, 2009 Wow, didn't know that, might be good for it to be put in later… Anyhow, thanks for the help, works like a charm now! 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