Help with LUA script menu

Shout-Out

User Tag List

Results 1 to 8 of 8
  1. #1
    blackfang500's Avatar Member
    Reputation
    35
    Join Date
    Apr 2007
    Posts
    491
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Help with LUA script

    So today I decided I would learn LUA to script bosses in my server. (It's a local server). I read the guide by Thekal (http://www.mmowned.com/forums/emulat...-tutorial.html) and decided I would make a simple script. So I took about 10-15 minutes writing it up and looking back at references and then I thought before I got deeper into it I would test it out. So I made my NPC and put in my script and it didnt load. I've had SEVERAL reasons it didnt, but I just cant get it to load the script.
    Code:
    function Demon_OnCombat(Unit,Event)
    Unit:SendChatMessage(14,0,"Entering Combat")
    end
    
    function Demon_OnDeath(Unit,Event)
    Unit:SendChatMessage(14,0,"I have died")
    Unit:ClearEvents()
    end
    
    function Demon_OnReset(Unit,Event)
    Unit:Sendchatmessage(14,0,"See you later.")
    Unit:ClearEvents()
    end
    
    function Demon_OnKill(Unit,Event)
    Unit:SendChatMessage(12,0,"Another one bites the dust")
    end
    
    function Demon_Shadowbolt(Unit,Event)
    Unit:FullCastSpellOnTarget(47809,Unit:GetMainTank())
    end
    
    function Phase_2(Unit,Event)
    if Unit:GetHealthPct() <= 40 then
    Unit:SendChatMessage(14,0,"PHASE TWO")
    Unit:SetModel(999)
    Unit:SetScale(3)
    Unit:CastSpell(30330)
    Unit:CastSpell(47867)
    end
    end
    
    RegisterUnitEvent(60000,1,"Demon_OnCombat")
    RegisterUnitEvent(60000,4,"Demon_OnDeath")
    RegisterUnitEvent(60000,2,"Demon_OnReset")
    RegisterUnitEvent(60000,3,"Demon_OnKill")
    RegisterUnitEvent("Demon_Shadowbolt",50000,5)
    end
    If you could analyze this and tell me what problems its infested with, that'd be great. I'll delete this when I'm done and rep whoever got it working. Hopefully I'll learn from this.
    Thanks in advance!
    Edit: I have another question, I was wondering if, in LUA, using caps matter or not. (Like if it mattered if I write "Function Demon_OnCombat" or "function Demon_OnCombat")

    EDIT 2: So I added end to the end of the registering section and now it will load my script... but it doesnt work. I still need your help!
    Last edited by <iostream>; 03-02-2009 at 08:48 PM.

  2. #2
    Alamos's Avatar Member
    Reputation
    5
    Join Date
    Jan 2009
    Posts
    15
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    hmmm, you forgot to make an RegisterUnitEvent on Phase_2, or?

    and you forgot to make the top registers

    copy from your guide:

    function Demon_OnCombat(Unit, Event)
    Unit:SendChatMessage(14, 0, "Casting Spell!")
    Unit:RegisterEvent("Demon_Spell1", 60000, 2)
    Unit:RegisterEvent("Demon_Summon", 60000, 2)
    Unit:RegisterEvent("Demon_Summon2", 60000, 2)
    Unit:RegisterEvent("Demon_Phase1", 5000, 1)
    end

    cant find that at your script.

  3. #3
    blackfang500's Avatar Member
    Reputation
    35
    Join Date
    Apr 2007
    Posts
    491
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by Alamos View Post
    hmmm, you forgot to make an RegisterUnitEvent on Phase_2, or?

    and you forgot to make the top registers

    copy from your guide:

    function Demon_OnCombat(Unit, Event)
    Unit:SendChatMessage(14, 0, "Casting Spell!")
    Unit:RegisterEvent("Demon_Spell1", 60000, 2)
    Unit:RegisterEvent("Demon_Summon", 60000, 2)
    Unit:RegisterEvent("Demon_Summon2", 60000, 2)
    Unit:RegisterEvent("Demon_Phase1", 5000, 1)
    end

    cant find that at your script.
    I took the summoning parts out, why should I be registering something that's not in my script?

    Any help?
    Last edited by 2dgreengiant; 03-03-2009 at 01:10 PM.

  4. #4
    kreegoth's Avatar Contributor
    Reputation
    122
    Join Date
    Jun 2008
    Posts
    810
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Add me to MSN my infos in my profile.. Im sure we can work out what the problem is easier on there.

  5. #5
    Alamos's Avatar Member
    Reputation
    5
    Join Date
    Jan 2009
    Posts
    15
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by blackfang500 View Post
    I took the summoning parts out, why should I be registering something that's not in my script?

    that was an example


    Where is your RegisterUnitEvent for Phase_2?

    function Demon_OnCombat(Unit,Event)
    Unit:SendChatMessage(14,0,"Entering Combat")
    end

    function Demon_OnDeath(Unit,Event)
    Unit:SendChatMessage(14,0,"I have died")
    Unit:ClearEvents()
    end

    function Demon_OnReset(Unit,Event)
    Unit:Sendchatmessage(14,0,"See you later.")
    Unit:ClearEvents()
    end

    function Demon_OnKill(Unit,Event)
    Unit:SendChatMessage(12,0,"Another one bites the dust")
    end

    function Demon_Shadowbolt(Unit,Event)
    Unit:FullCastSpellOnTarget(47809,Unit:GetMainTank())
    end

    function Phase_2(Unit,Event)
    if Unit:GetHealthPct() <= 40 then
    Unit:SendChatMessage(14,0,"PHASE TWO")
    Unit:SetModel(999)
    Unit:SetScale(3)
    Unit:CastSpell(30330)
    Unit:CastSpell(47867)
    end
    end

    RegisterUnitEvent(60000,1,"Demon_OnCombat")
    RegisterUnitEvent(60000,4,"Demon_OnDeath")
    RegisterUnitEvent(60000,2,"Demon_OnReset")
    RegisterUnitEvent(60000,3,"Demon_OnKill")
    RegisterUnitEvent("Demon_Shadowbolt",50000,5)
    end

  6. #6
    blackfang500's Avatar Member
    Reputation
    35
    Join Date
    Apr 2007
    Posts
    491
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Ah well... I'm not sure how to register that... Like...
    RegisterUnitEvent(60000,???,"Phase_2")
    ??? = ???????

  7. #7
    blackfang500's Avatar Member
    Reputation
    35
    Join Date
    Apr 2007
    Posts
    491
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Kreegoth,
    Code:
    function Demon_OnCombat(Unit,Event)
    Unit:SendChatMessage(14,0,"Entering Combat, LUA STYLE!")
    end
    
    function Demon_OnDeath(Unit,Event)
    Unit:SendChatMessage(14,0,"I have died, IN LUA!!!!")
    Unit:ClearEvents()
    end
    
    function Demon_OnReset(Unit,Event)
    Unit:Sendchatmessage(14,0,"See you later.")
    Unit:ClearEvents()
    end
    
    function Demon_OnKill(Unit,Event)
    Unit:SendChatMessage(12,0,"Another one bites the dust")
    end
    
    function Demon_Shadowbolt(Unit,Event)
    Unit:FullCastSpellOnTarget(47809,Unit:GetMainTank())
    end
    
    
    RegisterUnitEvent(60000,1,"Demon_OnCombat")
    RegisterUnitEvent(60000,4,"Demon_OnDeath")
    RegisterUnitEvent(60000,2,"Demon_OnReset")
    RegisterUnitEvent(60000,3,"Demon_OnKill")
    RegisterUnitEvent("Demon_Shadowbolt",50000,5)
    end
    Is what im doing now.
    I took the phase 2 part out because I dont know how to register it.
    Right now the error I get is
    "<eof> expected near 'end'"

  8. #8
    blackfang500's Avatar Member
    Reputation
    35
    Join Date
    Apr 2007
    Posts
    491
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Kreegoth has helped me with this specific problem and enlightened me in LUA, so no need posting in this thread anymore.

Similar Threads

  1. Need some help with LUA script
    By SupernovaHH in forum WoW EMU Questions & Requests
    Replies: 2
    Last Post: 07-22-2009, 07:25 AM
  2. Please help with Lua Script
    By Silentnvd in forum WoW EMU Questions & Requests
    Replies: 4
    Last Post: 09-23-2008, 11:16 PM
  3. help with lua script
    By mi_ninja in forum World of Warcraft Emulator Servers
    Replies: 11
    Last Post: 06-04-2008, 09:51 PM
  4. Anyone willing to help with LUA scripting
    By nickeg in forum World of Warcraft Emulator Servers
    Replies: 3
    Last Post: 03-09-2008, 05:53 PM
  5. [Request] I need some help with lua script (boss on death)
    By Ellenor in forum World of Warcraft Emulator Servers
    Replies: 2
    Last Post: 03-03-2008, 03:47 PM
All times are GMT -5. The time now is 12:14 PM. Powered by vBulletin® Version 4.2.3
Copyright © 2023 vBulletin Solutions, Inc. All rights reserved. User Alert System provided by Advanced User Tagging (Pro) - vBulletin Mods & Addons Copyright © 2023 DragonByte Technologies Ltd.
Digital Point modules: Sphinx-based search