Need LUA Help! menu

User Tag List

Results 1 to 7 of 7
  1. #1
    Dz The Rage's Avatar Member
    Reputation
    10
    Join Date
    Mar 2009
    Posts
    181
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Need LUA Help!

    Hi, I just tried to make my 1st LUA script yesterday for a boss on a private server i'm playing on, i emailed it to owner, but we didn't know where to put it. :confused: He said he put it in some script file, but idk the exact location, or something is wrong with my script itself, because it didn't do anything to boss...please comment if you know my problem. Orginally I had (Unit, Event) and not (pUnit, Event) does it make a diffrence? 1st day of scripting, don't bash too hard please . I want to try to become a Dev. for the server, but I don't know how to acess database and put LUA scripts into it, I really need a tutor, but the thread about free LUA help is non-leecher, even though this is my 1st thread and post on MMOwned in the week that i've just joined. When commenting consider me to be a LUA dumbass, since I just started today, i used a guide to make my script .

    Just realized a posted in wrong section, sorry!

    --------------------------------------------------------
    Script:

    function Nightclaw_OnCombat(pUnit, Event)
    pUnit:SendChatMessage(14, 0, "Foolish mortals, you dare enter the Chaos World!")
    pUnit:RegisterEvent("Nightclaw_Phase1, 600000000000000000000, 1")

    function Nightclaw_Phase1(pUnit, Event)
    if Unit:GetHealthPct() <= 50 then
    pUnit:CastSpell(52262)
    pUnit:Castspell(24169)
    pUnit:SendChatMessage(14, 0, "Playtime is over!")
    pUnit:SetScale(2)
    end
    end

    function Nightclaw_Attack1(pUnit,Event)
    pUnit:SendChatMessage(14, 0, "Slice n Dice")
    pUnit:FullCastSpellOnTarget(41078, Unit:GetClosestPlayer())
    end

    function Nightclaw_OnLeaveCombat(pUnit, Event)
    pUnit:SendChatMessage(14, 0, "The Chaos World reigns!"
    pUnit:RemoveEvents()
    end

    function Nightclaw_OnKilledTarget(pUnit, Event)
    pUnit:SendChatMessage(14, 0 "Pitiful mortal")
    end

    function Nightclaw_OnDied(pUnit, Event)
    pUnit:SendChatMessage(14, 0, "The Lord will not be as Merciful!")
    pUnit:RemoveEvents()
    end

    RegisterUnitEvent(124, 1, "Nightclaw_OnCombat")
    RegisterUnitEvent(124, 2, "Nightclaw_OnLeaveCombat")
    RegisterUnitEvent(124, 3, "Nightclaw_OnKilledTarget")
    RegisterUnitEvent(124, 4, "Nightclaw_OnDied")
    RegisterUnitEvent(124, "NightClawAttack1", 60000, 2)
    end
    Last edited by Dz The Rage; 04-02-2009 at 11:57 PM.

    Need LUA Help!
  2. #2
    crewd's Avatar Member
    Reputation
    2
    Join Date
    Jan 2008
    Posts
    29
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by Dz The Rage View Post
    Hi, I just tried to make my 1st LUA script yesterday for a boss on a private server i'm playing on, i emailed it to owner, but we didn't know where to put it. :confused: He said he put it in some script file, but idk the exact location, or something is wrong with my script itself, because it didn't do anything to boss...please comment if you know my problem. Orginally I had (Unit, Event) and not (pUnit, Event) does it make a diffrence? 1st day of scripting, don't bash too hard please . I want to try to become a Dev. for the server, but I don't know how to acess database and put LUA scripts into it, I really need a tutor, but the thread about free LUA help is non-leecher, even though this is my 1st thread and post on MMOwned in the week that i've just joined. When commenting consider me to be a LUA dumbass, since I just started today, i used a guide to make my script .

    Just realized a posted in wrong section, sorry!

    --------------------------------------------------------
    Script:

    function Nightclaw_OnCombat(pUnit, Event)
    pUnit:SendChatMessage(14, 0, "Foolish mortals, you dare enter the Chaos World!")
    pUnit:RegisterEvent("Nightclaw_Phase1, 600000000000000000000, 1")

    function Nightclaw_Phase1(pUnit, Event)
    if Unit:GetHealthPct() <= 50 then
    pUnit:CastSpell(52262)
    pUnit:Castspell(24169)
    pUnit:SendChatMessage(14, 0, "Playtime is over!")
    pUnit:SetScale(2)
    end
    end

    function Nightclaw_Attack1(pUnit,Event)
    pUnit:SendChatMessage(14, 0, "Slice n Dice")
    pUnit:FullCastSpellOnTarget(41078, Unit:GetClosestPlayer())
    end

    function Nightclaw_OnLeaveCombat(pUnit, Event)
    pUnit:SendChatMessage(14, 0, "The Chaos World reigns!"
    pUnit:RemoveEvents()
    end

    function Nightclaw_OnKilledTarget(pUnit, Event)
    pUnit:SendChatMessage(14, 0 "Pitiful mortal")
    end

    function Nightclaw_OnDied(pUnit, Event)
    pUnit:SendChatMessage(14, 0, "The Lord will not be as Merciful!")
    pUnit:RemoveEvents()
    end

    RegisterUnitEvent(124, 1, "Nightclaw_OnCombat")
    RegisterUnitEvent(124, 2, "Nightclaw_OnLeaveCombat")
    RegisterUnitEvent(124, 3, "Nightclaw_OnKilledTarget")
    RegisterUnitEvent(124, 4, "Nightclaw_OnDied")
    RegisterUnitEvent(124, "NightClawAttack1", 60000, 2)
    end
    pUnit:RegisterEvent("Nightclaw_Phase1, 600000000000000000000, 1")........ thats like 6 months before he activates phaste 1..set the 60000000000000 to like 1000

    RegisterUnitEvent(124, "NightClawAttack1", 60000, 2) is not valid
    make it into Unit:RegisterEvent("NightClawAttack1", 60000, 2) in your first function

    and yes your lua scripts go into your script folder
    make sure your configs have Lua Enabled as well

  3. #3
    Dz The Rage's Avatar Member
    Reputation
    10
    Join Date
    Mar 2009
    Posts
    181
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by crewd View Post
    pUnit:RegisterEvent("Nightclaw_Phase1, 600000000000000000000, 1")........ thats like 6 months before he activates phaste 1..set the 60000000000000 to like 1000

    RegisterUnitEvent(124, "NightClawAttack1", 60000, 2) is not valid
    make it into Unit:RegisterEvent("NightClawAttack1", 60000, 2) in your first function

    and yes your lua scripts go into your script folder
    make sure your configs have Lua Enabled as well
    Thanks +Rep for help

  4. #4
    Mildan's Avatar Member
    Reputation
    10
    Join Date
    Feb 2009
    Posts
    80
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Code:
    function Nightclaw_OnCombat(pUnit, Event)
    pUnit:SendChatMessage(14, 0, "Foolish mortals, you dare enter the Chaos World!")
    pUnit:RegisterEvent("Nightclaw_Phase1", 1000, 1)
    
    function Nightclaw_Phase1(pUnit, Event)
    if Unit:GetHealthPct() <= 50 then
    pUnit:CastSpell(52262)
    pUnit:Castspell(24169)
    pUnit:SendChatMessage(14, 0, "Playtime is over!")
    pUnit:SetScale(2)
    end
    end
    
    function Nightclaw_Attack1(pUnit,Event)
    pUnit:SendChatMessage(14, 0, "Slice n Dice")
    pUnit:FullCastSpellOnTarget(41078, Unit:GetClosestPlayer())
    end
    
    function Nightclaw_OnLeaveCombat(pUnit, Event)
    pUnit:SendChatMessage(14, 0, "The Chaos World reigns!"
    pUnit:RemoveEvents()
    end
    
    function Nightclaw_OnKilledTarget(pUnit, Event)
    pUnit:SendChatMessage(14, 0 "Pitiful mortal")
    end
    
    function Nightclaw_OnDied(pUnit, Event)
    pUnit:SendChatMessage(14, 0, "The Lord will not be as Merciful!")
    pUnit:RemoveEvents()
    end
    
    RegisterUnitEvent(124, 1, "Nightclaw_OnCombat")
    RegisterUnitEvent(124, 2, "Nightclaw_OnLeaveCombat")
    RegisterUnitEvent(124, 3, "Nightclaw_OnKilledTarget")
    RegisterUnitEvent(124, 4, "Nightclaw_OnDied")
    RegisterUnitEvent(124, "NightClawAttack1", 60000, 2)
    Try this, a few changes which might do the trick

  5. #5
    Jotox's Avatar Contributor
    Reputation
    250
    Join Date
    Mar 2008
    Posts
    282
    Thanks G/R
    0/4
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    If you don't already, make sure you have LUA enabled and put your LUA script in your scripts folder.

    Btw a few changes to your code should fix any bugs:
    Code:
    function Nightclaw_OnCombat(pUnit, Event)
    pUnit:SendChatMessage(14, 0, "Foolish mortals, you dare enter the Chaos World!")
    pUnit:RegisterEvent("Nightclaw_Phase1", 1000, 1)
    end
    
    function Nightclaw_Phase1(pUnit, Event)
    if pUnit:GetHealthPct() > 50 then return; end
    pUnit:CastSpell(52262)
    pUnit:Castspell(24169)
    pUnit:SendChatMessage(14, 0, "Playtime is over!")
    pUnit:SetScale(2)
    end
    
    function Nightclaw_Attack1(pUnit,Event)
    pUnit:SendChatMessage(14, 0, "Slice n Dice")
    pUnit:FullCastSpellOnTarget(41078, Unit:GetClosestPlayer())
    end
    
    function Nightclaw_OnLeaveCombat(pUnit, Event)
    pUnit:SendChatMessage(14, 0, "The Chaos World reigns!")
    pUnit:RemoveEvents()
    end
    
    function Nightclaw_OnKilledTarget(pUnit, Event)
    pUnit:SendChatMessage(14, 0 "Pitiful mortal")
    end
    
    function Nightclaw_OnDied(pUnit, Event)
    pUnit:SendChatMessage(14, 0, "The Lord will not be as Merciful!")
    pUnit:RemoveEvents()
    end
    
    RegisterUnitEvent(124, 1, "Nightclaw_OnCombat")
    RegisterUnitEvent(124, 2, "Nightclaw_OnLeaveCombat")
    RegisterUnitEvent(124, 3, "Nightclaw_OnKilledTarget")
    RegisterUnitEvent(124, 4, "Nightclaw_OnDied")
    RegisterUnitEvent(124, "NightClawAttack1", 60000, 2)
    Fixed a few errors and typos

  6. #6
    Dz The Rage's Avatar Member
    Reputation
    10
    Join Date
    Mar 2009
    Posts
    181
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Still Not working

    I don't get it, all the npc says when I try to attack him is "More bones to gnaw on..."

    I made a script for Hogger to try out my "skills" and he said "More bones to gnaw on..." instead of what I put for text....I using notepad and putting them into Script folder, is this wrong or right, im so :confused:

  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)
    Originally Posted by Dz The Rage View Post
    Hi, I just tried to make my 1st LUA script yesterday for a boss on a private server i'm playing on, i emailed it to owner, but we didn't know where to put it. :confused: He said he put it in some script file, but idk the exact location, or something is wrong with my script itself, because it didn't do anything to boss...please comment if you know my problem. Orginally I had (Unit, Event) and not (pUnit, Event) does it make a diffrence? 1st day of scripting, don't bash too hard please . I want to try to become a Dev. for the server, but I don't know how to acess database and put LUA scripts into it, I really need a tutor, but the thread about free LUA help is non-leecher, even though this is my 1st thread and post on MMOwned in the week that i've just joined. When commenting consider me to be a LUA dumbass, since I just started today, i used a guide to make my script .

    Just realized a posted in wrong section, sorry!

    --------------------------------------------------------
    Script:

    function Nightclaw_OnCombat(pUnit, Event)
    pUnit:SendChatMessage(14, 0, "Foolish mortals, you dare enter the Chaos World!")
    pUnit:RegisterEvent("Nightclaw_Phase1, 600000000000000000000, 1")

    function Nightclaw_Phase1(pUnit, Event)
    if Unit:GetHealthPct() <= 50 then
    pUnit:CastSpell(52262)
    pUnit:Castspell(24169)
    pUnit:SendChatMessage(14, 0, "Playtime is over!")
    pUnit:SetScale(2)
    end
    end

    function Nightclaw_Attack1(pUnit,Event)
    pUnit:SendChatMessage(14, 0, "Slice n Dice")
    pUnit:FullCastSpellOnTarget(41078, Unit:GetClosestPlayer())
    end

    function Nightclaw_OnLeaveCombat(pUnit, Event)
    pUnit:SendChatMessage(14, 0, "The Chaos World reigns!"
    pUnit:RemoveEvents()
    end

    function Nightclaw_OnKilledTarget(pUnit, Event)
    pUnit:SendChatMessage(14, 0 "Pitiful mortal")
    end

    function Nightclaw_OnDied(pUnit, Event)
    pUnit:SendChatMessage(14, 0, "The Lord will not be as Merciful!")
    pUnit:RemoveEvents()
    end

    RegisterUnitEvent(124, 1, "Nightclaw_OnCombat")
    RegisterUnitEvent(124, 2, "Nightclaw_OnLeaveCombat")
    RegisterUnitEvent(124, 3, "Nightclaw_OnKilledTarget")
    RegisterUnitEvent(124, 4, "Nightclaw_OnDied")
    RegisterUnitEvent(124, "NightClawAttack1", 60000, 2)
    end
    From what I see pUnit:RegisterEvent("Nightclaw_Phase1, 600000000000000000000, 1") is the problem. As someone said that is like 6 months before it activates. Make it look like this. And you missed quotes there.
    Code:
    pUnit:RegisterEvent("Nightclaw_Phase1", 1000, 0")
    With 1 even after 6 months it would check and then stop. You set it like this then it will check every second until his health is correct. Be sure to put a pUnit:RemoveEvents() to stop him from spamming though.

Similar Threads

  1. [Help] Need LUA help? Post here!
    By EcHoEs in forum World of Warcraft Emulator Servers
    Replies: 20
    Last Post: 10-03-2010, 01:18 PM
  2. Need Lua Help...
    By Meiya Stormsinger in forum WoW EMU Questions & Requests
    Replies: 1
    Last Post: 07-10-2009, 12:35 AM
  3. Need lua help
    By Noobcraft in forum World of Warcraft Emulator Servers
    Replies: 3
    Last Post: 07-31-2008, 07:13 PM
  4. Need .lua help! +rep
    By Kiev in forum World of Warcraft Emulator Servers
    Replies: 8
    Last Post: 06-15-2008, 06:14 PM
  5. [Help] i need Lua help with this script...
    By Ellenor in forum World of Warcraft Emulator Servers
    Replies: 25
    Last Post: 03-03-2008, 03:45 PM
All times are GMT -5. The time now is 03:48 AM. 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