Zamin Posted August 29, 2009 Author Share Posted August 29, 2009 Hello,This is what I did:in Sub ScriptedNPC```Case 1 Call CustomMenuClose(Index) Call CustomMenuShow(Index, "QuestExtra2", "\GUI\CUSTOM\QuestExtra\Menu.gif", 1) Call CustomMenuLabel(Index, 0, "Get a stick to advance to the next class!", 3, 3, 8, 0, 0, 190, 200) Call CustomMenuLabel(Index, 1, "I have stick!!", 3, 260, 8, 5, 0, 78, 15) Call CustomMenuLabel(Index, 2, "Close!", 150, 280, 8, 4, 0, 40, 15)Exit Sub```In Sub MenuScripts```If Clicked_Index = 2 Then Call CustomMenuClose(Index)ElseIf Clicked_Index = 1 Then If CanTake(Index, 3, 1) = false Then PlayerMsg(Index, "You didn't get the item! Go buy it from the merchant!", RED) Else Call TakeItem(index, 3, 1) Call SetPlayerSprite(Index, 2) PlayerMsg(Index, "Thanks, here's your reward!", RED) EndIfEndIf```I just can't figure what is wrong with this script. All I want to do it talk to the NPC, custom menu opens, if I click 'I have stick'. NPC checks, if so then it changes my sprite to '2'.But when I click on the menu, it doesn't recognize my click. The yellow line does not appear indicating which index I am clicking.Please let me know if I didn't something wrong in this code.-Thanks in advance Link to comment Share on other sites More sharing options...
JayT Posted August 29, 2009 Share Posted August 29, 2009 does it not recognize the close click aswell? Link to comment Share on other sites More sharing options...
Zamin Posted August 29, 2009 Author Share Posted August 29, 2009 @Snoop:> does it not recognize the close click aswell?Nope, nothing :(I think server screwed up. No? Link to comment Share on other sites More sharing options...
emblem Posted August 29, 2009 Share Posted August 29, 2009 ```Call PlayerMsg(Index, "Thanks, here's your reward!", RED)``` Link to comment Share on other sites More sharing options...
Zamin Posted August 29, 2009 Author Share Posted August 29, 2009 @Tylian!:> ```> Call PlayerMsg(Index, "Thanks, here's your reward!", RED)> > ```OMG!!!!!!!!!!!!!!!!!!!!I can't believe I messed that up. I could have at least looked at the above msg line, and a few dozen above that.-Thanks xDEDIT: OK, but it still doesn't recognize my click on the menu. :( Link to comment Share on other sites More sharing options...
JayT Posted August 29, 2009 Share Posted August 29, 2009 you missed another Call 3-4 lines above that 1 aswell Link to comment Share on other sites More sharing options...
Zamin Posted August 29, 2009 Author Share Posted August 29, 2009 @Snoop:> you missed another Call 3-4 lines above that 1 aswellThis time I tried it before posting. lol.Still doesn't recognizes my click. It seems that when I click, system doesn't enter the MenuScripts Sub at all. :( Link to comment Share on other sites More sharing options...
killerminx Posted August 29, 2009 Share Posted August 29, 2009 ```If Clicked_Index = 2 Then Call CustomMenuClose(Index)ElseIf Clicked_Index = 1 Then If CanTake(Index, 3, 1) = false Then Call PlayerMsg(Index, "You didn't get the item! Go buy it from the merchant!", RED) Else Call TakeItem(index, 3, 1) Call SetPlayerSprite(Index, 2) Call PlayerMsg(Index, "Thanks, here's your reward!", RED) EndIfEndIf```Code wise it looks good i think, Make sure your takeitem sub is there and workin, the only thing im thinking is most functions give numbers are you sure that cantake uses true and false?If anything can you show me the sub? Link to comment Share on other sites More sharing options...
JayT Posted August 29, 2009 Share Posted August 29, 2009 yer cantake uses true and false…...well it works for me anyways :) Link to comment Share on other sites More sharing options...
killerminx Posted August 29, 2009 Share Posted August 29, 2009 oh ok well then i see no problem with the code then, is the scripts working? as in /testscripts. Also try this```If Clicked_Index = 1 Then Call PlayerMsg(Index, "You clicked label 1", RED)ElseIf Clicked_Index = 2 Then Call PlayerMsg(Index, "You clicked label 2", RED)End IfCall CustomMenuClose(Index)```that should test to see if your labels are working also i noticed in the "endif" you forgot to separate them. Link to comment Share on other sites More sharing options...
Zamin Posted August 29, 2009 Author Share Posted August 29, 2009 Doesn't work man. I dunno why. This is so stupid. :(Which 'endif'?? Link to comment Share on other sites More sharing options...
Owen F Posted August 29, 2009 Share Posted August 29, 2009 EndIf is End If (two words, bud) Link to comment Share on other sites More sharing options...
killerminx Posted August 29, 2009 Share Posted August 29, 2009 ```If Clicked_Index = 2 Then Call CustomMenuClose(Index)ElseIf Clicked_Index = 1 Then If CanTake(Index, 3, 1) = false Then Call PlayerMsg(Index, "You didn't get the item! Go buy it from the merchant!", RED) Else Call TakeItem(index, 3, 1) Call SetPlayerSprite(Index, 2) Call PlayerMsg(Index, "Thanks, here's your reward!", RED) End IfEnd If``` Link to comment Share on other sites More sharing options...
Zamin Posted August 29, 2009 Author Share Posted August 29, 2009 @Owen:> EndIf is End If (two words, bud)OMG, no way. So that was the problem!! I checked. First I forgot to write 'Call' and now I forgot how to end if statements. xDCan't get any noobish than this. lol-Thanks to all for clearing the noobish mistakes. 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