[HELP] Lua script menu

Shout-Out

User Tag List

Results 1 to 9 of 9
  1. #1
    gotiefan's Avatar Sergeant
    Reputation
    1
    Join Date
    Jan 2008
    Posts
    54
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    [HELP] Lua script

    Hello,

    I was creating this LUA script and its not finished yet tho, but I was planning to test it.
    But it doesn't work!

    Could anyone check it for me + solve it, please?

    Code:
    function AllianceD_OnEnterCombat(pUnit, event, miscpUnit, misc)
    	pUnit:SendChatMessage(11, 0, "For the kingdom!")
    end
    
    function AllianceD_Phase1(pUnit, event, miscpUnit, misc)
    	if pUnit:GetHealthPct() < 95 then
    	pUnit:FullCastSpellOnTarget(36877,pUnit:GetRandomPlayer())
    	pUnit:SendChatMessage(11, 0, "Feel the power of the Alliance!")
    end
    
    function AllianceD_Phase2(pUnit, event, miscpUnit, misc)
    	if pUnit:GetHealthPct() < 80 then
    	pUnit:FullCastSpellOnTarget(29963,pUnit:GetRandomPlayer())
    	pUnit:FullCastSpellOnTarget(38589,pUnit:GetRandomPlayer())
    end
    
    function AllianceD_Phase3(Unit, Event)
    	if pUnit:GetHealthPct() < 50 then
    	pUnit:SendChatMessage(11, 0, "Fellow guards, attack!")
    	local x = Unit:GetX()
    	local y = Unit:GetY()
    	local z = Unit:GetZ()
    	local o = Unit:GetO()
    	Unit:SpawnCreature(1423, x, y, z, o, 1638, 600000)
    	Unit:SpawnCreature(1423, x, y, z, o, 1638, 600000)
    	Unit:SpawnCreature(1423, x, y, z, o, 1638, 600000)
    	Unit:SpawnCreature(1423, x, y, z, o, 1638, 600000)
    	Unit:SpawnCreature(1423, x, y, z, o, 1638, 600000)
    	Unit:SpawnCreature(1423, x, y, z, o, 1638, 600000)
    end
    
    RegisterUnitEvent(466, 1, "AllianceD_OnEnterCombat")
    RegisterUnitEvent(466, 2, "AllianceD_Phase1")
    RegisterUnitEvent(466, 3, "AllianceD_Phase2")
    RegisterUnitEvent(466, 4, "AllianceD_Phase3")
    I actually think the RegisterEvents ain't correct, cause I do not know how to fill them in.

    Greets.

    [HELP] Lua script
  2. #2
    Power of Illuminati's Avatar Contributor
    Reputation
    179
    Join Date
    May 2008
    Posts
    1,410
    Thanks G/R
    6/2
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Test with this.. I'm not a lua pro but I fixed some stuff atleast

    Code:
    function AllianceD_OnEnterCombat(pUnit, Event)
        pUnit:SendChatMessage(11, 0, "For the kingdom!")
            pUnit:RegisterEvent(AllianceD_Phase1, 1000, 0)
    end
    
    function AllianceD_Phase1(pUnit, Event)
            if pUnit:GetHealthPct() < 95 then
        pUnit:FullCastSpellOnTarget(36877,pUnit:GetRandomPlayer())
        pUnit:SendChatMessage(11, 0, "Feel the power of the Alliance!")
            pUnit:RegisterEvent(AllianceD_Phase2, 1000, 0)
            end
    end
    
    function AllianceD_Phase2(pUnit, Event)
            if pUnit:GetHealthPct() < 80 then
        pUnit:FullCastSpellOnTarget(29963,pUnit:GetRandomPlayer())
        pUnit:FullCastSpellOnTarget(38589,pUnit:GetRandomPlayer())
            pUnit:RegisterEvent(AllianceD_Phase3, 1000, 0)
            end
    end
    
    function AllianceD_Phase3(Unit, Event)
        if pUnit:GetHealthPct() < 50 then
        pUnit:SendChatMessage(11, 0, "Fellow guards, attack!")
        local x = Unit:GetX()
        local y = Unit:GetY()
        local z = Unit:GetZ()
        local o = Unit:GetO()
        Unit:SpawnCreature(1423, x, y, z, o, 1638, 600000)
        Unit:SpawnCreature(1423, x, y, z, o, 1638, 600000)
        Unit:SpawnCreature(1423, x, y, z, o, 1638, 600000)
        Unit:SpawnCreature(1423, x, y, z, o, 1638, 600000)
        Unit:SpawnCreature(1423, x, y, z, o, 1638, 600000)
        Unit:SpawnCreature(1423, x, y, z, o, 1638, 600000)
            end
    end
    
    RegisterUnitEvent(466, 1, "AllianceD_OnEnterCombat")

  3. #3
    TheSpidey's Avatar Elite User
    Reputation
    365
    Join Date
    Jan 2008
    Posts
    2,200
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    You have no 'end' for your 'if's.

  4. #4
    gotiefan's Avatar Sergeant
    Reputation
    1
    Join Date
    Jan 2008
    Posts
    54
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    The script ain't giving errors now, if I start the core.
    But I don't see something that directs to the creature entry '466'

    Edit:

    Tested and didn't work.
    Nothing worked.

  5. #5
    gotiefan's Avatar Sergeant
    Reputation
    1
    Join Date
    Jan 2008
    Posts
    54
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I think there are problems with the RegisterEvent.

    # School

  6. #6
    TheSpidey's Avatar Elite User
    Reputation
    365
    Join Date
    Jan 2008
    Posts
    2,200
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Did you enable Lua? :P

    Is there an npc with entry 466 in your DB?

  7. #7
    gotiefan's Avatar Sergeant
    Reputation
    1
    Join Date
    Jan 2008
    Posts
    54
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by TheSpidey View Post
    Did you enable Lua? :P

    Is there an npc with entry 466 in your DB?
    Lua is enabled.
    And yes, the NPC entry is 466


    General Marcus Jonathan - High Commander of Stormwind Defense

  8. #8
    Whitethebunny's Avatar Member
    Reputation
    2
    Join Date
    Apr 2008
    Posts
    16
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    function AllianceD_Phase3(Unit, Event)
    if pUnit:GetHealthPct() < 50 then
    pUnit:SendChatMessage(11, 0, "Fellow guards, attack!")



    Change the pUnit to Unit.

  9. #9
    gotiefan's Avatar Sergeant
    Reputation
    1
    Join Date
    Jan 2008
    Posts
    54
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    That doesn't solve it...

    I am 99% sure it has to do something with the RegisterEvent

Similar Threads

  1. Help lua scripts
    By juaking2 in forum World of Warcraft Emulator Servers
    Replies: 1
    Last Post: 05-23-2008, 07:39 PM
  2. [Help] LUA Script
    By stoneharry in forum World of Warcraft Emulator Servers
    Replies: 15
    Last Post: 04-27-2008, 05:26 PM
  3. /Help/Lua Script i think
    By luddo9 in forum World of Warcraft Emulator Servers
    Replies: 2
    Last Post: 03-25-2008, 01:50 PM
  4. [Help] Lua Script Not Working
    By Muruk in forum World of Warcraft Emulator Servers
    Replies: 26
    Last Post: 03-16-2008, 02:13 PM
  5. [Help] LUA Script + GO info
    By Hellgawd in forum World of Warcraft Emulator Servers
    Replies: 4
    Last Post: 02-12-2008, 05:06 AM
All times are GMT -5. The time now is 03:32 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