[LUA] Question menu

User Tag List

Results 1 to 10 of 10
  1. #1
    Algorithm's Avatar Member
    Reputation
    175
    Join Date
    Mar 2008
    Posts
    395
    Thanks G/R
    0/1
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    [LUA] Question

    Guys i have a question .

    I am going crazy trying to figure this one out

    so i made an Lua portal

    Code:
    function Teleporting_onUse (pUnit, Event, pMisc)
    pMisc:Teleport (30, -1326.63, -297.884, 91.536)
    end
    RegisterGameObjectEvent (380007, 2, 'Teleporting_onUse')
    and
    Code:
    function Teleporting_onUse (pUnit, Event, pMisc)
    pMisc:Teleport (30, -476.417, -196.086, 55.7934)
    end
    RegisterGameObjectEvent (280006, 2, 'Teleporting_onUse')

    now the wierd thing is :

    when i click on portal , both of them bringing me to the same location and some world recall msg appeares sometimes.

    does anyone know what am i doing wrong?

    [LUA] Question
  2. #2
    Juicyz's Avatar Active Member
    Reputation
    34
    Join Date
    Dec 2006
    Posts
    298
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Umm I think I know What Is Wrong..... The Spell you are using to teleport, U already have too many of them, U have to use a different spell to teleport so it doesnt get confusing to the tables ( I guess) So basicall say u are using Teleport: Goldshire use a different one like Teleport:Moonglade and maybe that will fix it

    DA Gift From Mr. Blain

  3. #3
    latruwski's Avatar Banned
    Reputation
    647
    Join Date
    Dec 2006
    Posts
    2,456
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    did you put both in 1 lua file?
    you might wanna change one of the:
    Teleporting_onUse to Teleporting2_onUse

  4. #4
    Algorithm's Avatar Member
    Reputation
    175
    Join Date
    Mar 2008
    Posts
    395
    Thanks G/R
    0/1
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    2 files

    Originally Posted by latruwski View Post
    did you put both in 1 lua file?
    you might wanna change one of the:
    Teleporting_onUse to Teleporting2_onUse
    No Sir, i have 2 different files

    i just dont get it

  5. #5
    Sonic Waffle's Avatar Contributor
    Reputation
    170
    Join Date
    Dec 2007
    Posts
    990
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Try this:
    Code:
    function Teleporting_onUse (pUnit, Event)
        pUnit:Teleport (30, -1326.63, -297.884, 91.536, 1)
    end
    RegisterGameObjectEvent (380007, 2, "Teleporting_onUse");
    Code:
    function Teleporting_onUse (pUnit, Event)
        pUnit:Teleport (30, -476.417, -196.086, 55.7934, 1)
    end
    RegisterGameObjectEvent (280006, 2, "Teleporting_onUse");
    Last edited by Sonic Waffle; 04-14-2008 at 08:57 AM.


  6. #6
    Algorithm's Avatar Member
    Reputation
    175
    Join Date
    Mar 2008
    Posts
    395
    Thanks G/R
    0/1
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by pigpoo View Post
    Try this:
    Code:
    function Teleporting_onUse (pUnit, Event)
        pUnit:Teleport (30, -1326.63, -297.884, 91.536, 1)
    end
    RegisterGameObjectEvent (380007, 2, "Teleporting_onUse");
    Code:
    function Teleporting_onUse (pUnit, Event)
        pUnit:Teleport (30, -476.417, -196.086, 55.7934, 1)
    end
    RegisterGameObjectEvent (280006, 2, "Teleporting_onUse");
    nope still same thingy

  7. #7
    b!atch's Avatar Member
    Reputation
    118
    Join Date
    Oct 2007
    Posts
    726
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Same function name is baaad:P
    Spectrum-X is win! Rep People That Help You and Candybones Wont Eat Your Brain:>

  8. #8
    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)
    Yeah the problem is that you have two functions that are named the same thing. Make one Teleporting_onUse1 and the other Teleporting_onUse2, cuz if you name them the same thing then the second one overwrites the first one and ignores the first one entirely.

  9. #9
    CairiFEA's Avatar Member
    Reputation
    36
    Join Date
    Jan 2008
    Posts
    194
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    ^^^^ Yes, this is the matter even if you make them seperate files.

    Always have different names for ALL your functions.

    Cairi
    Cairi
    As a Nation, we have AGREED to A GREED
    gmtricks.com

  10. #10
    latruwski's Avatar Banned
    Reputation
    647
    Join Date
    Dec 2006
    Posts
    2,456
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by Jotox1 View Post
    Yeah the problem is that you have two functions that are named the same thing. Make one Teleporting_onUse1 and the other Teleporting_onUse2, cuz if you name them the same thing then the second one overwrites the first one and ignores the first one entirely.
    Like i said... same name is looking for troubles :P

Similar Threads

  1. Unit Event Lua Question (Gossip Talk)
    By moongo in forum World of Warcraft Emulator Servers
    Replies: 4
    Last Post: 05-22-2008, 07:49 PM
  2. [LUA Question] Is it possible..?
    By Greeko in forum World of Warcraft Emulator Servers
    Replies: 1
    Last Post: 04-14-2008, 02:49 PM
  3. LUA Question (advanced?)
    By CairiFEA in forum World of Warcraft Emulator Servers
    Replies: 5
    Last Post: 04-13-2008, 01:57 AM
  4. LUA Question
    By CairiFEA in forum World of Warcraft Emulator Servers
    Replies: 8
    Last Post: 04-10-2008, 08:10 PM
  5. script lua question
    By onilank in forum World of Warcraft Emulator Servers
    Replies: 2
    Last Post: 12-21-2007, 06:58 PM
All times are GMT -5. The time now is 08:48 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