[LUA] Problem with my lua menu

User Tag List

Results 1 to 2 of 2
  1. #1
    Corosive720's Avatar Member
    Reputation
    11
    Join Date
    Nov 2007
    Posts
    156
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    [LUA] Problem with my lua

    Okay this is the error i get when i try to load my script

    Sneed-Boss.LUA:40: 'end' expected (to closed 'function' at line 6)

    heres my lua
    Code:
    function Sneed_Shredder_Volley(Unit, Event)
       Unit:CastSpell(37161)
       Unit:CastSpell(30007)
    end
    
    function Sneed_Shredder_Spawn(Unit, Event)
       Unit:RemoveEvents()
    if Unit:GetHealthPct() < 2 then
       Unit:SpawnCreature(64002,Unit:GetX(),Unit:GetY(),Unit:GetZ(),7,0)
    end
    
    function Sneed_Shredder_Cleave(Unit, Event)
       Unit:FullCastSpellOnTarget(30014, Unit:GetRandomPlayer(0))
    end
       
    function Sneed_Shredder_Disarm(Unit, Event)
       Unit:CastSpell(30013)
    end
    
    function Sneed_Shredder_onCombat(Unit, Event)
       Unit:RegisterEvent("Sneed_Shredder_Cleave",10000,0)
       Unit:RegisterEvent("Sneed_Shredder_Volley",35000,0)
       Unit:RegisterEvent("Sneed_Shredder_Disarm",20000,0)
       Unit:RegisterEvent("Sneed_Shredder_Spawn",1000,0)
       Unit:SendChatMessage(12,0,"We shall not be defeated!")
       Unit:CastSpell(29982)
      end
    
    function Sneed_Shredder_onLeaveCombat(Unit, Event)
       Unit:RemoveEvents()
    end
    
    function Sneed_Shredder_onDeath(Unit, Event)
       Unit:SendChatMessage(12,0,"Gah! No not my machine")
       Unit:RemoveEvents()
    end
    
    RegisterUnitEvent(64001, 1, "Sneed_Shredder_onCombat")
    RegisterUnitEvent(64001, 2, "Sneed_Shredder_onLeaveCombat")
    RegisterUnitEvent(64001, 4, "Sneed_Shredder_onDeath")
    And help would be create

    [LUA] Problem with my lua
  2. #2
    Aznex's Avatar Contributor
    Reputation
    128
    Join Date
    Feb 2008
    Posts
    770
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Code:
     function Sneed_Shredder_Volley(Unit, Event)
       Unit:CastSpell(37161)
       Unit:CastSpell(30007)
    end
    
    function Sneed_Shredder_Spawn(Unit, Event)
       Unit:RemoveEvents()
    if Unit:GetHealthPct() < 2 then
       Unit:SpawnCreature(64002,Unit:GetX(),Unit:GetY(),Unit:GetZ(),7,0)
    end
    
    function Sneed_Shredder_Cleave(Unit, Event)
       Unit:FullCastSpellOnTarget(30014, Unit:GetRandomPlayer(0))
    end
       
    function Sneed_Shredder_Disarm(Unit, Event)
       Unit:CastSpell(30013)
    end
    
    function Sneed_Shredder_onCombat(Unit, Event)
       Unit:RegisterEvent("Sneed_Shredder_Cleave",10000,0)
       Unit:RegisterEvent("Sneed_Shredder_Volley",35000,0)
       Unit:RegisterEvent("Sneed_Shredder_Disarm",20000,0)
       Unit:RegisterEvent("Sneed_Shredder_Spawn",1000,0)
       Unit:SendChatMessage(12,0,"We shall not be defeated!")
       Unit:CastSpell(29982)
      end
    
    function Sneed_Shredder_onLeaveCombat(Unit, Event)
       Unit:RemoveEvents()
    end
    
    function Sneed_Shredder_onDeath(Unit, Event)
       Unit:SendChatMessage(12,0,"Gah! No not my machine")
       Unit:RemoveEvents()
    end
    end
    
    RegisterUnitEvent(64001, 1, "Sneed_Shredder_onCombat")
    RegisterUnitEvent(64001, 2, "Sneed_Shredder_onLeaveCombat")
    RegisterUnitEvent(64001, 4, "Sneed_Shredder_onDeath")
    Code:
    function Sneed_Shredder_Spawn(Unit, Event)
       Unit:RemoveEvents()
    if Unit:GetHealthPct() < 2 then
       Unit:SpawnCreature(64002,Unit:GetX(),Unit:GetY(),Unit:GetZ(),7,0)
    end
    the function requires one "end" and the if statement requires another
    so i added one at the end

Similar Threads

  1. [Lua] - Problem With Teleporter
    By shadowslayer133 in forum WoW EMU Questions & Requests
    Replies: 2
    Last Post: 09-16-2008, 04:02 PM
  2. [Help Plzzzz] LUA Problem with KJ Script
    By Arthas117 in forum WoW EMU Questions & Requests
    Replies: 3
    Last Post: 08-16-2008, 05:25 PM
  3. Problem with lua boss script
    By nickeg in forum WoW EMU Questions & Requests
    Replies: 13
    Last Post: 08-16-2008, 09:22 AM
  4. [Help] problem with Lua
    By Edude in forum World of Warcraft Emulator Servers
    Replies: 5
    Last Post: 08-05-2008, 11:15 AM
  5. [Question]Problem with enabling lua
    By Corosive720 in forum World of Warcraft Emulator Servers
    Replies: 5
    Last Post: 01-23-2008, 12:01 PM
All times are GMT -5. The time now is 08:11 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