[Lua] Problem with my lua code menu

Shout-Out

User Tag List

Results 1 to 8 of 8
  1. #1
    ariax1's Avatar Member
    Reputation
    1
    Join Date
    Aug 2008
    Posts
    12
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    [Lua] Problem with my lua code

    hey!

    I got a little problem with my lua code. When starting ascent-world and its about to load it itsays "failed.could not load"

    Code:
    function Roshan_OnCombat(Unit, Event) 
    Unit:SendChatMessage(12, 0, "You dare to disturb Roshan in his meditation!? You shall be crushed!")
    Unit:RegisterEvent("Roshan_GroundStomp", 2000, 5)
    Unit:RegisterEvent("Roshan_36836", 3000, 8)
    Unit:RegisterEvent("Roshan_Immolation",1000,0)
    end
    
    function Roshan_GroundStomp(pUnit, Event) 
    pUnit:CastSpell(19364, pUnit:GetClosestPlayer()) 
    end
    
    function Roshan_36836(pUnit, Event) 
    pUnit:FullCastSpellOnTarget(36836, pUnit:GetMainTank()) 
    end
    
    function Roshan_Immolation(pUnit, Event) 
    pUnit:CastSpell(12744, ) 
    end
    
    function Roshan_Immolation(pUnit, Event) 
    if pUnit:GetHealthPct() < 50 then 
    pUnit:RemoveEvents(); 
    pUnit:FullCastSpell(0)
    end 
    end
    
    function RoshanLeaveCombat_OnLeaveCombat(Unit, Event) 
    Unit:RemoveEvents() 
    Unit:SendChatMessage(12, 0, "Come back when you are a bit stronger...") 
    end
    
    function RoshanDeath_OnDied(Unit, Event) 
    Unit:RemoveEvents() 
    Unit:SendChatMessage(11, 0, "Do not rejoice...Your victory is only a part of the plan...I will come back even stronger and more powerful...But until then...You...have...defeated...me.....") 
    end
    
    function RoshanKillTarget_OnKilledTarget(Unit, Event) 
    Unit:SendChatMessage(12, 0, "One more soul goes down!") 
    end
    
    RegisterUnitEvent(17898, 1, "Roshan_OnCombat")
    RegisterUnitEvent(17898, 2, "RoshanLeaveCombat_OnLeaveCombat")
    RegisterUnitEvent(17898, 3, "RoshanKillTarget_OnKilledTarget")
    RegisterUnitEvent(17898, 4, "RoshanDeath_OnDied")
    please help me some1?

    BTW this is my first lua code :P
    Last edited by ariax1; 09-25-2008 at 09:39 AM.

    [Lua] Problem with my lua code
  2. #2
    Reflection's Avatar Legendary
    Reputation
    783
    Join Date
    Mar 2008
    Posts
    3,377
    Thanks G/R
    1/2
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Post full error please.

    Freelance Digital Artist
    https://reflectionartwork.deviantart.com
    You did not desert me
    My brothers in arms


  3. #3
    Babbaa's Avatar Member
    Reputation
    32
    Join Date
    Nov 2007
    Posts
    206
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Code:
    function Roshan_OnCombat(Unit, Event) 
    Unit:SendChatMessage(12, 0, "You dare to disturb Roshan in his meditation!? You shall be crushed!")
    Unit:RegisterEvent("Roshan_GroundStomp", 2000, 5)
    Unit:RegisterEvent("Roshan_36836", 3000, 8)
    Unit:RegisterEvent("Roshan_Immolation",1000,0)
    end
    
    function Roshan_GroundStomp(Unit, Event) 
    Unit:CastSpell(19364, pUnit:GetClosestPlayer()) 
    end
    
    function Roshan_36836(Unit, Event) 
    Unit:FullCastSpellOnTarget(36836, Unit:GetMainTank()) 
    end
    
    function Roshan_Immolation(Unit, Event) 
    Unit:CastSpell(12744) 
    end
    
    function Roshan_Immolation(Unit, Event) 
    if Unit:GetHealthPct() < 50 then 
    Unit:RemoveEvents() 
    Unit:FullCastSpell(0)
    end 
    end
    
    function RoshanLeaveCombat_OnLeaveCombat(Unit, Event) 
    Unit:RemoveEvents() 
    Unit:SendChatMessage(12, 0, "Come back when you are a bit stronger...") 
    end
    
    function RoshanDeath_OnDied(Unit, Event) 
    Unit:RemoveEvents() 
    Unit:SendChatMessage(11, 0, "Do not rejoice...Your victory is only a part of the plan...I will come back even stronger and more powerful...But until then...You...have...defeated...me.....") 
    end
    
    function RoshanKillTarget_OnKilledTarget(Unit, Event) 
    Unit:SendChatMessage(12, 0, "One more soul goes down!") 
    end
    
    RegisterUnitEvent(17898, 1, "Roshan_OnCombat")
    RegisterUnitEvent(17898, 2, "RoshanLeaveCombat_OnLeaveCombat")
    RegisterUnitEvent(17898, 3, "RoshanKillTarget_OnKilledTarget")
    RegisterUnitEvent(17898, 4, "RoshanDeath_OnDied")
    Might wanna try it now.
    And PLEASE, provide MORE information about your error.

  4. #4
    ariax1's Avatar Member
    Reputation
    1
    Join Date
    Aug 2008
    Posts
    12
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Full error message :
    failed. could not load
    scripts\roshan.lua:17: unexpected symbol near ')'

  5. #5
    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)
    pUnit:CastSpell(12744, )
    guessing you forgot to fill in who to target?

  6. #6
    xX EPIC Xx's Avatar Active Member
    Reputation
    37
    Join Date
    Apr 2008
    Posts
    238
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    function Roshan_GroundStomp(Unit, Event)
    Unit:CastSpell(19364, pUnit:GetClosestPlayer())
    end

    function Roshan_36836(Unit, Event)
    Unit:FullCastSpellOnTarget(36836, Unit:GetMainTank())

    change it to

    function Roshan_GroundStomp(Unit, Event)
    Unit:CastSpell(19364, pUnit:GetClosestPlayer()
    end

    function Roshan_36836(Unit, Event)
    Unit:FullCastSpellOnTarget(36836, Unit:GetMainTank()

  7. #7
    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)
    Originally Posted by colamancool View Post
    function Roshan_GroundStomp(Unit, Event)
    Unit:CastSpell(19364, pUnit:GetClosestPlayer())
    end

    function Roshan_36836(Unit, Event)
    Unit:FullCastSpellOnTarget(36836, Unit:GetMainTank())

    change it to

    function Roshan_GroundStomp(Unit, Event)
    Unit:CastSpell(19364, pUnit:GetClosestPlayer()
    end

    function Roshan_36836(Unit, Event)
    Unit:FullCastSpellOnTarget(36836, Unit:GetMainTank()
    I'm sorry to dissapoint, but no.

    its ()) from

    Unit:GetMainTank()
    and an extra ) to close FullCastSpellOnTarget(
    so it is indeed
    FullCastSpellOnTarget(36836, Unit:GetMainTank())

  8. #8
    sammiboy's Avatar Member
    Reputation
    10
    Join Date
    May 2007
    Posts
    65
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Yep ... Aznex is right.

    Change

    Code:
    function Roshan_Immolation(Unit, Event) 
    Unit:CastSpell(12744) 
    end
    into:

    Code:
    function Roshan_Immolation(Unit, Event) 
    Unit:CastSpell(12744, pUnit:GetClosestPlayer()) 
    end
    Must not be GetClosestPlayer ... Can be whatever. GetMainTank .. Yeah I think you get me. :yuck:
    Also Knowned as Samloo


Similar Threads

  1. [Lua] Got a problem with my Lua code.
    By sammiboy in forum WoW EMU Questions & Requests
    Replies: 2
    Last Post: 09-25-2008, 09:04 AM
  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 02:43 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