Script Problem menu

User Tag List

Results 1 to 5 of 5
  1. #1
    TheNacho's Avatar Member
    Reputation
    12
    Join Date
    Apr 2008
    Posts
    47
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Script Problem

    I attempted my first LUA script today, but when I try to start up my server something goes wrong. My script is (for a buff NPC):

    Code:
    function buff_NPC(unit, event, player)
    unit:GossipCreateMenu(100, player, 0)
    unit:GossipMenuAddItem(5, "Armor + 10%", 1, 0)
    unit:GossipMenuAddItem(5, "Damage + 1 - 10%", 2, 0)
    unit:GossipMenuAddItem(5, "Resistances + 25", 3, 0)
    unit:GossipMenuAddItem(5, "Agility + 10%", 4, 0)
    unit:GossipMenuAddItem(5, "Intelligence + 10%", 5, 0)
    unit:GossipMenuAddItem(5, "Spirit + 10%", 6, 0)
    unit:GossipMenuAddItem(5, "Strength + 10%", 7, 0)
    unit:GossipMenuAddItem(5, "Stamina + 10%", 8, 0)
    unit:GossipSendMenu(player)
    end
    
    function buff_NPC_back(unit, event, player, id, intid, code)
    if(intid == 75) then
    unit:GossipCreateMenu(78, player, 0)
    unit:GossipMenuAddItem(2, "Armor + 10%", 1, 0)
    unit:GossipMenuAddItem(2, "Damage + 1 - 10%", 2, 0)
    unit:GossipMenuAddItem(2, "Resistances + 25", 3, 0)
    unit:GossipMenuAddItem(2, "Agility + 10%", 4, 0)
    unit:GossipMenuAddItem(2, "Intelligence + 10%", 5, 0)
    unit:GossipMenuAddItem(2, "Spirit + 10%", 6, 0)
    unit:GossipMenuAddItem(2, "Strength + 10%", 7, 0)
    unit:GossipMenuAddItem(2, "Stamina + 10%", 8, 0)
    unit:GossipSendMenu(player)
    end
    
    if(intid == 1) then
    unit:GossipCreateMenu(61, player, 0)
    unit:FullCastSpellOnTarget(23767, player)
    unit:GossipMenuAddItem(0, "[Back]", 75, 0)
    unit:GossipSendMenu(player)
    end
    
    if(intid == 2) then
    unit:GossipCreateMenu(61, player, 0)
    unit:FullCastSpellOnTarget(23768, player)
    unit:GossipMenuAddItem(0, "[Back]", 75, 0)
    unit:GossipSendMenu(player)
    end
    
    if(intid == 3) then
    unit:GossipCreateMenu(61, player, 0)
    unit:FullCastSpellOnTarget(23769, player)
    unit:GossipMenuAddItem(0, "[Back]", 75, 0)
    unit:GossipSendMenu(player)
    end
    
    if(intid == 4) then
    unit:GossipCreateMenu(61, player, 0)
    unit:FullCastSpellOnTarget(23736, player)
    unit:GossipMenuAddItem(0, "[Back]", 75, 0)
    unit:GossipSendMenu(player)
    end
    
    if(intid == 5) then
    unit:GossipCreateMenu(61, player, 0)
    unit:FullCastSpellOnTarget(23766, player)
    unit:GossipMenuAddItem(0, "[Back]", 75, 0)
    unit:GossipSendMenu(player)
    end
    
    if(intid == 6) then
    unit:GossipCreateMenu(61, player, 0)
    unit:FullCastSpellOnTarget(23738, player)
    unit:GossipMenuAddItem(0, "[Back]", 75, 0)
    unit:GossipSendMenu(player)
    end
    
    if(intid == 7) then
    unit:GossipCreateMenu(61, player, 0)
    unit:FullCastSpellOnTarget(23735, player)
    unit:GossipMenuAddItem(0, "[Back]", 75, 0)
    unit:GossipSendMenu(player)
    end
    
    if(intid == 8) then
    unit:GossipCreateMenu(61, player, 0)
    unit:FullCastSpellOnTarget(23737, player)
    unit:GossipMenuAddItem(0, "[Back]", 75, 0)
    unit:GossipSendMenu(player)
    end
    
    
    RegisterUnitGossipEvent(78005, 1, "buff_NPC")
    RegisterUnitGossipEvent(78005, 2, "buff_NPC_back")
    And the error message I get is:

    Code:
    The "Buffbot".lua...
    failed. (could not load)
    	scripts/The "Buffbot".lua:86: 'end' expected (to close 'function' at line 14) near '<eof>'

    Script Problem
  2. #2
    Zudrik's Avatar Member
    Reputation
    52
    Join Date
    Dec 2008
    Posts
    169
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hmm, I would first try adding another "end" at the end first. So it would be like

    Code:
    if(intid == 8) then
    unit:GossipCreateMenu(61, player, 0)
    unit:FullCastSpellOnTarget(23737, player)
    unit:GossipMenuAddItem(0, "[Back]", 75, 0)
    unit:GossipSendMenu(player)
    end
    end
    
    RegisterUnitGossipEvent(78005, 1, "buff_NPC")
    RegisterUnitGossipEvent(78005, 2, "buff_NPC_back")

  3. #3
    TheNacho's Avatar Member
    Reputation
    12
    Join Date
    Apr 2008
    Posts
    47
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Ooh, I didn't see that I forgot that. lol. +rep for the help.

  4. #4
    Zudrik's Avatar Member
    Reputation
    52
    Join Date
    Dec 2008
    Posts
    169
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Lol, well did it work?

  5. #5
    TheNacho's Avatar Member
    Reputation
    12
    Join Date
    Apr 2008
    Posts
    47
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Sure did.

    fillerlol

Similar Threads

  1. [HELP]C++ Script Problem
    By swmr1991 in forum World of Warcraft Emulator Servers
    Replies: 2
    Last Post: 06-23-2008, 10:24 PM
  2. [Help] Fairly large Lua script problem
    By Muruk in forum World of Warcraft Emulator Servers
    Replies: 10
    Last Post: 03-16-2008, 09:03 PM
  3. LUA Scripting Problem
    By Knife in forum World of Warcraft Emulator Servers
    Replies: 18
    Last Post: 03-10-2008, 02:00 PM
  4. Lua scripts problem
    By Mr.Ice.Cold in forum World of Warcraft Emulator Servers
    Replies: 12
    Last Post: 02-02-2008, 11:44 AM
  5. Lua Boss Script Problems!!
    By blah7 in forum World of Warcraft Emulator Servers
    Replies: 14
    Last Post: 01-22-2008, 08:59 PM
All times are GMT -5. The time now is 05:38 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