[Help!] Scripting a GO object with LUA??? menu

User Tag List

Results 1 to 6 of 6
  1. #1
    pioneer1337's Avatar Member
    Reputation
    7
    Join Date
    Nov 2007
    Posts
    39
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    [Help!] Scripting a GO object with LUA???

    Well I saw a guide on how to script a game object to teleport you somewhere (Portal...) and I wa swondering if it would be possible to script it to do other things liek cast a spell on you...?
    Here's the script I wrote and I was wondering why it wont work:
    Code:
    function Cannon_onUse (pUnit, Event, pMisc)
    print "Cannon launched!"
    pMisc:CastSpell (42867);
    end
    RegisterGameObjectEvent (186560, 2, "Cannon_onUse")
    It says "Cannon launched!" in the arcemu-world.exe window so I know it half-works but it just wont cast the spell on the player...
    Last edited by pioneer1337; 07-31-2008 at 09:32 PM.
    How do you wake up when the nightmare is real?

    [Help!] Scripting a GO object with LUA???
  2. #2
    Shao111's Avatar Active Member
    Reputation
    33
    Join Date
    Jul 2007
    Posts
    281
    Thanks G/R
    1/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Give this a try, havent tested but may work.
    Code:
    function Cannon_onUse (pUnit, Event, pMisc)
    print "Cannon launched!"
    pUnit:CastSpell (42867);
    end
    RegisterGameObjectEvent (186560, 2, "Cannon_onUse")

  3. #3
    mager1794's Avatar Member
    Reputation
    356
    Join Date
    Feb 2008
    Posts
    703
    Thanks G/R
    0/1
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    you have to make it select a target and then CastSpellOnTarget
    like this

    Code:
    function Cannon_onUse (pUnit, Event, pMisc)
    print "Cannon launched!"
    pUnit:CastSpellOnTarget(42867, pUnit:GetClosestPlayer());
    end
    RegisterGameObjectEvent (186560, 2, "Cannon_onUse")
    Lunar Gaming - Reaching For The Stars

  4. #4
    pioneer1337's Avatar Member
    Reputation
    7
    Join Date
    Nov 2007
    Posts
    39
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by Shao111 View Post
    Give this a try, havent tested but may work.
    Code:
    function Cannon_onUse (pUnit, Event, pMisc)
    print "Cannon launched!"
    pUnit:CastSpell (42867);
    end
    RegisterGameObjectEvent (186560, 2, "Cannon_onUse")
    Hmmm... I got different results with that.. now in the arcemu-world.exe window it says: "...attempt to call method 'CastSpell' <a nil value>".
    How do you wake up when the nightmare is real?

  5. #5
    pioneer1337's Avatar Member
    Reputation
    7
    Join Date
    Nov 2007
    Posts
    39
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks mager1794, it works now.
    How do you wake up when the nightmare is real?

  6. #6
    mager1794's Avatar Member
    Reputation
    356
    Join Date
    Feb 2008
    Posts
    703
    Thanks G/R
    0/1
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    its what i do
    Lunar Gaming - Reaching For The Stars

Similar Threads

  1. [Tutorial] [Tutorial] How to Script a Phased Boss With LUA.
    By Dimarxx in forum WoW EMU Guides & Tutorials
    Replies: 3
    Last Post: 07-26-2010, 05:06 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 08:30 PM. Powered by vBulletin® Version 4.2.3
Copyright © 2024 vBulletin Solutions, Inc. All rights reserved. User Alert System provided by Advanced User Tagging (Pro) - vBulletin Mods & Addons Copyright © 2024 DragonByte Technologies Ltd.
Digital Point modules: Sphinx-based search