Results 1 to 7 of 7
  1. #1
    Master Sergeant cello1993's Avatar
    Reputation
    4
    Join Date
    Sep 2006
    Posts
    121
    Thanks G/R
    0/0
    CoreCoins
    0
    Trade Feedback
    0 (0%)

    [FIX] This Lua. Script plzzzZ?

    Code:
    function Ro_OnCombat(pUnit, event)
    Unit:SendChatMessage(14, 0, "Wanna play with cold You will get frozen")
    end
    RegisterUnitEvent(99008, 1, "Ro_OnCombat")
    function Ro_CastFrostbolt(pUnit, event)
    Unit:FullCastSpellOnTarget(61594, pUnit:GetRandomPlayer(0))
    Unit:SendChatMessage(14, 0, "Frost vaess! Wux geou lapiet malrak ias Ro uikulph arcaniss!")
    end
    RegisterUnitEvent(99008, 1, "Ro_CastFrostbolt")
    function Ro_OnCombat(pUnit, event)
    Unit:RegisterEvent("Ro_CastFrostbolt", 180000, 1)
    end
    function Ro_SummonGulSpeak1(pUnit, event) 
    if Unit:GetHealthPct() <= 75 then
    Unit:SendChatMessage(14, 0, "De wer veditoa part di wer malrunwa, sI symmn thes Gul!")
    end
    end
    RegisterUnitEvent(99008, 1, "Ro_SummonGulSpeak1")
    function Ro_SummonGul1(pUnit, event) 
    if Unit:GetHealthPct() <= 75 then
    Unit:SpawnCreature(99009, -6.53875, 156.701659, 40.384003)
    Unit:SpawnCreature(99009, -6.83875, 156.701659, 40.384003)
    Unit:SpawnCreature(99009, -7.13875, 156.701659, 40.384003)
    Unit:SpawnCreature(99009, -7.43875, 156.701659, 40.384003)
    Unit:SpawnCreature(99009, -7.73875, 156.701659, 40.384003)
    Unit:SpawnCreature(99009, -8.03875, 156.701659, 40.384003)
    Unit:SpawnCreature(99009, -8.33875, 156.701659, 40.384003)
    Unit:SpawnCreature(99009, -8.53875, 156.701659, 40.384003)
    Unit:SpawnCreature(99009, -8.83875, 156.701659, 40.384003)
    Unit:SpawnCreature(99009, -9.13875, 156.701659, 40.384003)
    Unit:SpawnCreature(99009, -9.63875, 156.701659, 40.384003)
    Unit:SpawnCreature(99009, -10.03875, 156.701659, 40.384003)
    Unit:SpawnCreature(99009, -10.33875, 156.701659, 40.384003)
    Unit:SpawnCreature(99009, -10.63875, 156.701659, 40.384003)
    Unit:SpawnCreature(99009, -10.93875, 156.701659, 40.384003)
    Unit:SpawnCreature(99009, -11.33875, 156.701659, 40.384003)
    Unit:SpawnCreature(99009, -11.73875, 156.701659, 40.384003)
    Unit:SpawnCreature(99009, -12.03875, 156.701659, 40.384003)
    Unit:SpawnCreature(99009, -12.33875, 156.701659, 40.384003)
    Unit:SpawnCreature(99009, -12.73875, 156.701659, 40.384003)
    Unit:SpawnCreature(99009, -12.43875, 156.701659, 40.384003)
    Unit:SpawnCreature(99009, -12.83875, 156.701659, 40.384003)
    Unit:SpawnCreature(99009, -13.13875, 156.701659, 40.384003)
    Unit:SpawnCreature(99009, -13.43875, 156.701659, 40.384003)
    Unit:SpawnCreature(99009, -13.73875, 156.701659, 40.384003)
    end
    end
    RegisterUnitEvent(99008, 1, "Ro_SummonGul1")
    function Ro_SummonGulSpeak2(pUnit, Event)
    if Unit:GetHealthPct() <= 50 then
    Unit:SendChatMessage(14, 0, "De wer veditoa part di wer malrunwa, sI symmn thes Gul!")
    end
    end
    RegisterUnitEvent(99008, 1, "Ro_SummonGulSpeak2")
    function Ro_SummonGul2(pUnit, Event)
    if Unit:GetHealthPct() <= 50 then
    Unit:SpawnCreature(99009, -6.53875, 156.701659, 40.384003)
    Unit:SpawnCreature(99009, -6.83875, 156.701659, 40.384003)
    Unit:SpawnCreature(99009, -7.13875, 156.701659, 40.384003)
    Unit:SpawnCreature(99009, -7.43875, 156.701659, 40.384003)
    Unit:SpawnCreature(99009, -7.73875, 156.701659, 40.384003)
    Unit:SpawnCreature(99009, -8.03875, 156.701659, 40.384003)
    Unit:SpawnCreature(99009, -8.33875, 156.701659, 40.384003)
    Unit:SpawnCreature(99009, -8.53875, 156.701659, 40.384003)
    Unit:SpawnCreature(99009, -8.83875, 156.701659, 40.384003)
    Unit:SpawnCreature(99009, -9.13875, 156.701659, 40.384003)
    Unit:SpawnCreature(99009, -9.63875, 156.701659, 40.384003)
    Unit:SpawnCreature(99009, -10.03875, 156.701659, 40.384003)
    Unit:SpawnCreature(99009, -10.33875, 156.701659, 40.384003)
    Unit:SpawnCreature(99009, -10.63875, 156.701659, 40.384003)
    Unit:SpawnCreature(99009, -10.93875, 156.701659, 40.384003)
    Unit:SpawnCreature(99009, -11.33875, 156.701659, 40.384003)
    Unit:SpawnCreature(99009, -11.73875, 156.701659, 40.384003)
    Unit:SpawnCreature(99009, -12.03875, 156.701659, 40.384003)
    Unit:SpawnCreature(99009, -12.33875, 156.701659, 40.384003)
    Unit:SpawnCreature(99009, -12.73875, 156.701659, 40.384003)
    Unit:SpawnCreature(99009, -12.43875, 156.701659, 40.384003)
    Unit:SpawnCreature(99009, -12.83875, 156.701659, 40.384003)
    Unit:SpawnCreature(99009, -13.13875, 156.701659, 40.384003)
    Unit:SpawnCreature(99009, -13.43875, 156.701659, 40.384003)
    Unit:SpawnCreature(99009, -13.73875, 156.701659, 40.384003)
    end
    end
    RegisterUnitEvent(99008, 1, "Ro_SummonGul2")
    function Ro_SummonGulSpeak3(pUnit, Event)
    if Unit:GetHealthPct() <= 25 then
    Unit:SendChatMessage(14, 0, "De wer veditoa part di wer malrunwa, sI symmn thes Gul!")
    end
    end
    RegisterUnitEvent(99008, 1, "Ro_SummonGulSpeak3") 
    function Ro_SummonGul3(pUnit, Event)
    if Unit:GetHealthPct() <= 25 then
    Unit:SpawnCreature(99009, -6.53875, 156.701659, 40.384003)
    Unit:SpawnCreature(99009, -6.83875, 156.701659, 40.384003)
    Unit:SpawnCreature(99009, -7.13875, 156.701659, 40.384003)
    Unit:SpawnCreature(99009, -7.43875, 156.701659, 40.384003)
    Unit:SpawnCreature(99009, -7.73875, 156.701659, 40.384003)
    Unit:SpawnCreature(99009, -8.03875, 156.701659, 40.384003)
    Unit:SpawnCreature(99009, -8.33875, 156.701659, 40.384003)
    Unit:SpawnCreature(99009, -8.53875, 156.701659, 40.384003)
    Unit:SpawnCreature(99009, -8.83875, 156.701659, 40.384003)
    Unit:SpawnCreature(99009, -9.13875, 156.701659, 40.384003)
    Unit:SpawnCreature(99009, -9.63875, 156.701659, 40.384003)
    Unit:SpawnCreature(99009, -10.03875, 156.701659, 40.384003)
    Unit:SpawnCreature(99009, -10.33875, 156.701659, 40.384003)
    Unit:SpawnCreature(99009, -10.63875, 156.701659, 40.384003)
    Unit:SpawnCreature(99009, -10.93875, 156.701659, 40.384003)
    Unit:SpawnCreature(99009, -11.33875, 156.701659, 40.384003)
    Unit:SpawnCreature(99009, -11.73875, 156.701659, 40.384003)
    Unit:SpawnCreature(99009, -12.03875, 156.701659, 40.384003)
    Unit:SpawnCreature(99009, -12.33875, 156.701659, 40.384003)
    Unit:SpawnCreature(99009, -12.73875, 156.701659, 40.384003)
    Unit:SpawnCreature(99009, -12.43875, 156.701659, 40.384003)
    Unit:SpawnCreature(99009, -12.83875, 156.701659, 40.384003)
    Unit:SpawnCreature(99009, -13.13875, 156.701659, 40.384003)
    Unit:SpawnCreature(99009, -13.43875, 156.701659, 40.384003)
    Unit:SpawnCreature(99009, -13.73875, 156.701659, 40.384003)
    end
    end
    RegisterUnitEvent(99008, 1, "Ro_SummonGul3")
    Whats wrong??? I was having a "unable to load" arcemu.world error, then I chnged it this way and loads fine but ..... THE DAMN NPC doesn't do anything!!! I'm getting crazy!

    Please somebody have mercy and tell me what's wrong >.<

  2. #2
    Account not activated by Email Gastricpenguin's Avatar
    Reputation
    980
    Join Date
    Feb 2007
    Posts
    2,237
    Thanks G/R
    0/0
    CoreCoins
    2
    Trade Feedback
    0 (0%)
    Why are you registering every function for the oncombat hook? Ie:
    RegisterUnitEvent(99008, 1, "Ro_OnCombat")
    RegisterUnitEvent(99008, 1, "Ro_CastFrostbolt")
    RegisterUnitEvent(99008, 1, "Ro_SummonGulSpeak1")
    RegisterUnitEvent(99008, 1, "Ro_SummonGul3")
    etc
    etc
    etc

  3. #3
    Master Sergeant Mircast's Avatar
    Reputation
    14
    Join Date
    Sep 2008
    Posts
    139
    Thanks G/R
    0/0
    CoreCoins
    0
    Trade Feedback
    0 (0%)
    Quote Originally Posted by Gastricpenguin View Post
    Why are you registering every function for the oncombat hook? Ie:
    RegisterUnitEvent(99008, 1, "Ro_OnCombat")
    RegisterUnitEvent(99008, 1, "Ro_CastFrostbolt")
    RegisterUnitEvent(99008, 1, "Ro_SummonGulSpeak1")
    RegisterUnitEvent(99008, 1, "Ro_SummonGul3")
    etc
    etc
    etc
    I'm guessing he hasn't learned lua completely.

  4. #4
    Lieutenant Commander y2kss66's Avatar
    Reputation
    104
    Join Date
    Jan 2008
    Posts
    778
    Thanks G/R
    0/0
    CoreCoins
    0
    Trade Feedback
    0 (0%)
    you are registering all of the phases in no mans land basically.

    you need to register the events inside the end statements.


  5. #5
    Master Sergeant cello1993's Avatar
    Reputation
    4
    Join Date
    Sep 2006
    Posts
    121
    Thanks G/R
    0/0
    CoreCoins
    0
    Trade Feedback
    0 (0%)
    humm .... yea I'm new to lua. scripting sorry .... I didn't understand well what you guys said =S could you maybe post an exemple of how it should looks like? Thanks!

  6. #6
    Contributor CoreCoins User Linkn's Avatar
    Reputation
    90
    Join Date
    Mar 2009
    Posts
    296
    Thanks G/R
    0/0
    CoreCoins
    1001
    Trade Feedback
    1 (100%)
    Try this

    function Ro_OnCombat(Unit, Event)
    Unit:SendChatMessage(14, 0, "Wanna play with cold, You will get frozen")
    Unit:RegisterEvent("Ro_CastFrostbolt", 9000, 0)
    end

    function Ro_CastFrostbolt(Unit, Event)
    Unit:FullCastSpellOnTarget(61594, Unit:GetRandomPlayer(0))
    Unit:SendChatMessage(14, 0, "Frost vaess! Wux geou lapiet malrak ias Ro uikulph arcaniss!")
    Unit:RegisterEvent("Ro_SummonGul1", 1000, 0)
    end

    function Ro_SummonGul1(Unit, event)
    if Unit:GetHealthPct() <= 75 then
    Unit:SendChatMessage(14, 0, "De wer veditoa part di wer malrunwa, sI symmn thes Gul!")
    Unit:SpawnCreature(99009, -6.53875, 156.701659, 40.384003)
    Unit:SpawnCreature(99009, -6.83875, 156.701659, 40.384003)
    Unit:SpawnCreature(99009, -7.13875, 156.701659, 40.384003)
    Unit:SpawnCreature(99009, -7.43875, 156.701659, 40.384003)
    Unit:SpawnCreature(99009, -7.73875, 156.701659, 40.384003)
    Unit:SpawnCreature(99009, -8.03875, 156.701659, 40.384003)
    Unit:SpawnCreature(99009, -8.33875, 156.701659, 40.384003)
    Unit:SpawnCreature(99009, -8.53875, 156.701659, 40.384003)
    Unit:SpawnCreature(99009, -8.83875, 156.701659, 40.384003)
    Unit:SpawnCreature(99009, -9.13875, 156.701659, 40.384003)
    Unit:SpawnCreature(99009, -9.63875, 156.701659, 40.384003)
    Unit:SpawnCreature(99009, -10.03875, 156.701659, 40.384003)
    Unit:SpawnCreature(99009, -10.33875, 156.701659, 40.384003)
    Unit:SpawnCreature(99009, -10.63875, 156.701659, 40.384003)
    Unit:SpawnCreature(99009, -10.93875, 156.701659, 40.384003)
    Unit:SpawnCreature(99009, -11.33875, 156.701659, 40.384003)
    Unit:SpawnCreature(99009, -11.73875, 156.701659, 40.384003)
    Unit:SpawnCreature(99009, -12.03875, 156.701659, 40.384003)
    Unit:SpawnCreature(99009, -12.33875, 156.701659, 40.384003)
    Unit:SpawnCreature(99009, -12.73875, 156.701659, 40.384003)
    Unit:SpawnCreature(99009, -12.43875, 156.701659, 40.384003)
    Unit:SpawnCreature(99009, -12.83875, 156.701659, 40.384003)
    Unit:SpawnCreature(99009, -13.13875, 156.701659, 40.384003)
    Unit:SpawnCreature(99009, -13.43875, 156.701659, 40.384003)
    Unit:SpawnCreature(99009, -13.73875, 156.701659, 40.384003)
    Unit:RegisterEvent("Ro_SummonGul2", 1000, 0)
    end
    end

    function Ro_SummonGul2(Unit, Event)
    if Unit:GetHealthPct() <= 50 then
    Unit:SendChatMessage(14, 0, "De wer veditoa part di wer malrunwa, sI symmn thes Gul!")
    Unit:SpawnCreature(99009, -6.53875, 156.701659, 40.384003)
    Unit:SpawnCreature(99009, -6.83875, 156.701659, 40.384003)
    Unit:SpawnCreature(99009, -7.13875, 156.701659, 40.384003)
    Unit:SpawnCreature(99009, -7.43875, 156.701659, 40.384003)
    Unit:SpawnCreature(99009, -7.73875, 156.701659, 40.384003)
    Unit:SpawnCreature(99009, -8.03875, 156.701659, 40.384003)
    Unit:SpawnCreature(99009, -8.33875, 156.701659, 40.384003)
    Unit:SpawnCreature(99009, -8.53875, 156.701659, 40.384003)
    Unit:SpawnCreature(99009, -8.83875, 156.701659, 40.384003)
    Unit:SpawnCreature(99009, -9.13875, 156.701659, 40.384003)
    Unit:SpawnCreature(99009, -9.63875, 156.701659, 40.384003)
    Unit:SpawnCreature(99009, -10.03875, 156.701659, 40.384003)
    Unit:SpawnCreature(99009, -10.33875, 156.701659, 40.384003)
    Unit:SpawnCreature(99009, -10.63875, 156.701659, 40.384003)
    Unit:SpawnCreature(99009, -10.93875, 156.701659, 40.384003)
    Unit:SpawnCreature(99009, -11.33875, 156.701659, 40.384003)
    Unit:SpawnCreature(99009, -11.73875, 156.701659, 40.384003)
    Unit:SpawnCreature(99009, -12.03875, 156.701659, 40.384003)
    Unit:SpawnCreature(99009, -12.33875, 156.701659, 40.384003)
    Unit:SpawnCreature(99009, -12.73875, 156.701659, 40.384003)
    Unit:SpawnCreature(99009, -12.43875, 156.701659, 40.384003)
    Unit:SpawnCreature(99009, -12.83875, 156.701659, 40.384003)
    Unit:SpawnCreature(99009, -13.13875, 156.701659, 40.384003)
    Unit:SpawnCreature(99009, -13.43875, 156.701659, 40.384003)
    Unit:SpawnCreature(99009, -13.73875, 156.701659, 40.384003)
    Unit:RegisterEvent("Ro_SummonGul3", 1000, 0)
    end
    end

    function Ro_SummonGul3(Unit, Event)
    if Unit:GetHealthPct() <= 25 then
    Unit:SendChatMessage(14, 0, "De wer veditoa part di wer malrunwa, sI symmn thes Gul!")
    Unit:SpawnCreature(99009, -6.53875, 156.701659, 40.384003)
    Unit:SpawnCreature(99009, -6.83875, 156.701659, 40.384003)
    Unit:SpawnCreature(99009, -7.13875, 156.701659, 40.384003)
    Unit:SpawnCreature(99009, -7.43875, 156.701659, 40.384003)
    Unit:SpawnCreature(99009, -7.73875, 156.701659, 40.384003)
    Unit:SpawnCreature(99009, -8.03875, 156.701659, 40.384003)
    Unit:SpawnCreature(99009, -8.33875, 156.701659, 40.384003)
    Unit:SpawnCreature(99009, -8.53875, 156.701659, 40.384003)
    Unit:SpawnCreature(99009, -8.83875, 156.701659, 40.384003)
    Unit:SpawnCreature(99009, -9.13875, 156.701659, 40.384003)
    Unit:SpawnCreature(99009, -9.63875, 156.701659, 40.384003)
    Unit:SpawnCreature(99009, -10.03875, 156.701659, 40.384003)
    Unit:SpawnCreature(99009, -10.33875, 156.701659, 40.384003)
    Unit:SpawnCreature(99009, -10.63875, 156.701659, 40.384003)
    Unit:SpawnCreature(99009, -10.93875, 156.701659, 40.384003)
    Unit:SpawnCreature(99009, -11.33875, 156.701659, 40.384003)
    Unit:SpawnCreature(99009, -11.73875, 156.701659, 40.384003)
    Unit:SpawnCreature(99009, -12.03875, 156.701659, 40.384003)
    Unit:SpawnCreature(99009, -12.33875, 156.701659, 40.384003)
    Unit:SpawnCreature(99009, -12.73875, 156.701659, 40.384003)
    Unit:SpawnCreature(99009, -12.43875, 156.701659, 40.384003)
    Unit:SpawnCreature(99009, -12.83875, 156.701659, 40.384003)
    Unit:SpawnCreature(99009, -13.13875, 156.701659, 40.384003)
    Unit:SpawnCreature(99009, -13.43875, 156.701659, 40.384003)
    Unit:SpawnCreature(99009, -13.73875, 156.701659, 40.384003)
    end
    end

    function Ro_OnLeaveCombat(Unit, Event)
    Unit:RemoveEvents()
    end

    function Ro_OnKilledTarget(Unit, Event)
    end

    function Ro_OnDied(Unit, Event)
    Unit:RemoveEvents()
    end

    RegisterUnitEvent(99008, 1, "Ro_OnCombat")
    RegisterUnitEvent(99008, 2, "Ro_OnLeaveCombat")
    RegisterUnitEvent(99008, 3, "Ro_OnKilledTarget")
    RegisterUnitEvent(99008, 4, "Ro_OnDied")

  7. #7
    Master Sergeant cello1993's Avatar
    Reputation
    4
    Join Date
    Sep 2006
    Posts
    121
    Thanks G/R
    0/0
    CoreCoins
    0
    Trade Feedback
    0 (0%)
    YeA i managed to make it work ^^ I'm using "local x: Get Unit x" (or somethin like that you know?) ... sounds easier and quite better, but the problem is that all NPCs spawns at the smae point >.< and to make them not to occupe the same spot, I'm looking after on how to enable COLLISION .... I made another thread about it, If you got any information plzz help me there =/

    Thanks you all ^^"

 

 

Similar Threads

  1. Fix my LUA script.
    By [Stefon] in forum World of Warcraft Emulator Servers
    Replies: 7
    Last Post: 06-30-2008, 05:09 PM
  2. [helpzerz] What is wrong with this lua script?
    By w21froster in forum World of Warcraft Emulator Servers
    Replies: 8
    Last Post: 05-21-2008, 10:45 PM
  3. Whats wrong with this LUA Script?
    By controlsx2 in forum World of Warcraft Emulator Servers
    Replies: 1
    Last Post: 05-20-2008, 04:03 PM
  4. Help with this LUA script
    By jordash in forum World of Warcraft Emulator Servers
    Replies: 7
    Last Post: 03-08-2008, 04:19 PM
  5. How to fix this LUA Script???
    By marcosgue in forum World of Warcraft Emulator Servers
    Replies: 0
    Last Post: 02-08-2008, 07:51 AM
All times are GMT -5. The time now is 07:39 AM. Powered by vBulletin® Version 4.2.3
Copyright © 2017 vBulletin Solutions, Inc. All rights reserved. Digital Point modules: Sphinx-based search