Item Script Help menu

Shout-Out

User Tag List

Results 1 to 10 of 10
  1. #1
    BADBUDZ's Avatar Member
    Reputation
    3
    Join Date
    Mar 2008
    Posts
    35
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Item Script Help

    hi i hope you all can help me im trying to script an item to teleport a player to only one place but the script dont work when my realm server loads it gives the following error message "allspark(2).lua:10: '<eof>' expected near 'end' "
    any help would be great


    Heres what i got sofar
    Code:
    function Allspark_Trigger(item, event, player)
             Item_menu(item, player)
     end
    
    function Item_menu(item, player)
             item:GossipCreateMenu(3543, player, 0)
             item:GossipMenuAddItem(2, "The Battle Continues", 2, 0)
             item:GossipSendMenu(player)
         end
      end
    end
    
     function OnSelect(item, event, player, id, intid, code)
           if (intid == 2) then
              item:GossipCreateMenu(3543, player, 0)
              item:GossipMenuAddItem(2, "Go To The Final Battle", 40, 0)
              item:GossipSendMenu(player)
          end
           if (intid == 40) then
              player:Teleport(1, 16244.436523, 16165.692383, 12.170164)
          end
    
              RegisterItemGossipEvent(60064,1,"Allspark_Trigger")
              RegisterItemGossipEvent(60064,2,"OnSelect")
    Last edited by BADBUDZ; 06-14-2009 at 08:28 AM.

    Item Script Help
  2. #2
    Kaidos's Avatar Contributor
    Reputation
    148
    Join Date
    Jun 2008
    Posts
    324
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Code:
    function Allspark_Trigger(item, event, player)
             Item_menu(item, player)
     end
    
    function Item_menu(item, player)
             item:GossipCreateMenu(3543, player, 0)
             item:GossipMenuAddItem(2, "The Battle Continues", 2, 0)
             item:GossipSendMenu(player)
    end
    
     function OnSelect(item, event, player, id, intid, code)
           if (intid == 2) then
             item:GossipCreateMenu(3543, player, 0)
             item:GossipMenuAddItem(2, "Go To The Final Battle", 40, 0)
             item:GossipSendMenu(player)
           end
           if (intid == 40) then
             player:Teleport(0, -8913, 555, 95)
           end
    end
    
              RegisterItemGossipEvent(60064,1,"Allspark_Trigger")
              RegisterItemGossipEvent(60064,2,"OnSelect")
    Try this

  3. #3
    stoneharry's Avatar Moderator Harry


    Reputation
    1618
    Join Date
    Sep 2007
    Posts
    4,564
    Thanks G/R
    151/150
    Trade Feedback
    0 (0%)
    Mentioned
    4 Post(s)
    Tagged
    0 Thread(s)
    The error is telling you it is at line 10. So if we go to line 10 we can see that this is a function, so it must be somewhere in this part. Now it tells you it's expected near an end, if we have a look you can see you need one end for the function, and there are no if statements or anything so you can thats all you need. The problem is that you have three end's, and you don't need three, only one.
    Now the next function, same thing:

    Code:
     function OnSelect(item, event, player, id, intid, code)
           if (intid == 2) then
              item:GossipCreateMenu(3543, player, 0)
              item:GossipMenuAddItem(2, "Go To The Final Battle", 40, 0)
              item:GossipSendMenu(player)
          end
           if (intid == 40) then
              player:Teleport(0, -8913, 555, 95)
          end
    should be:

    Code:
     function OnSelect(item, event, player, id, intid, code)
           if (intid == 2) then
              item:GossipCreateMenu(3543, player, 0)
              item:GossipMenuAddItem(2, "Go To The Final Battle", 40, 0)
              item:GossipSendMenu(player)
          end
           if (intid == 40) then
              player:Teleport(0, -8913, 555, 95)
          end
    end
    Because you need to end the function and the if statements.

    Edit: Xendro beat me to it.

  4. #4
    BADBUDZ's Avatar Member
    Reputation
    3
    Join Date
    Mar 2008
    Posts
    35
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    thanx both for your help i will try this now thanx
    + rep for you both

  5. #5
    Kaidos's Avatar Contributor
    Reputation
    148
    Join Date
    Jun 2008
    Posts
    324
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Yeah, but you have a better explanation, Stoneharry!

  6. #6
    BADBUDZ's Avatar Member
    Reputation
    3
    Join Date
    Mar 2008
    Posts
    35
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by BADBUDZ View Post
    thanx both for your help i will try this now thanx
    + rep for you both
    sorry stoneharry its said ive repped you too much
    also loadded fine now thanx again

  7. #7
    BADBUDZ's Avatar Member
    Reputation
    3
    Join Date
    Mar 2008
    Posts
    35
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    ive got another problem with this when i click the item it teleports me but the menu doesn't appear can you give me any help on this matter

  8. #8
    Kaidos's Avatar Contributor
    Reputation
    148
    Join Date
    Jun 2008
    Posts
    324
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Code:
    function Allspark_Trigger(item, event, player)
             Item_menu(item, player)
     end
    
    function Item_menu(item, player)
             item:GossipCreateMenu(3543, player, 0)
             item:GossipMenuAddItem(2, "The Battle Continues", 2, 0)
             item:GossipSendMenu(player)
    end
    
     function OnSelect(item, event, player, id, intid, code)
           if (intid == 2) then
             item:GossipCreateMenu(3543, player, 0) -- change to 3544 or something
             item:GossipMenuAddItem(2, "Go To The Final Battle", 40, 0)
             item:GossipSendMenu(player)
           end
           if (intid == 40) then
             player:Teleport(0, -8913, 555, 95)
           end
    end
    
              RegisterItemGossipEvent(60064,1,"Allspark_Trigger")
              RegisterItemGossipEvent(60064,2,"OnSelect")
    You need a unique id there.

  9. #9
    BADBUDZ's Avatar Member
    Reputation
    3
    Join Date
    Mar 2008
    Posts
    35
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    how would i find one

  10. #10
    Kaidos's Avatar Contributor
    Reputation
    148
    Join Date
    Jun 2008
    Posts
    324
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by BADBUDZ View Post
    how would i find one

    you can add a random number there

    it only must be unique^^

Similar Threads

  1. [Help] C++ Item Script
    By mager1794 in forum World of Warcraft Emulator Servers
    Replies: 4
    Last Post: 07-08-2008, 08:38 PM
  2. Scripting help please will +rep need for a new server
    By runiker in forum WoW EMU Guides & Tutorials
    Replies: 0
    Last Post: 01-22-2008, 04:05 AM
  3. [Ascent] Boss Scripts help
    By n0t5ew in forum World of Warcraft Emulator Servers
    Replies: 1
    Last Post: 12-24-2007, 03:04 PM
  4. Removing Items , need help
    By entrepid in forum World of Warcraft Emulator Servers
    Replies: 18
    Last Post: 11-10-2007, 11:38 AM
  5. Custom Item Creation HELP
    By noodels in forum World of Warcraft General
    Replies: 5
    Last Post: 11-09-2007, 03:03 AM
All times are GMT -5. The time now is 08:31 PM. Powered by vBulletin® Version 4.2.3
Copyright © 2025 vBulletin Solutions, Inc. All rights reserved. User Alert System provided by Advanced User Tagging (Pro) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
Google Authenticator verification provided by Two-Factor Authentication (Free) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
Digital Point modules: Sphinx-based search