Gameobject LUA Teleport Different Races menu

Shout-Out

User Tag List

Results 1 to 4 of 4
  1. #1
    MikeJB's Avatar Private
    Reputation
    2
    Join Date
    Feb 2010
    Posts
    3
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Gameobject LUA Teleport Different Races

    Hi guys, Sorry I'm a lazy Leacher, but I will be posting helpful things soon enough.
    At the moment I need help with a LUA script for a gameobject that teleports you different places depending on your race.

    This is what I had, but its .gm, So if anyone could help me out with the LUA format of it, it would be greatly appreciated


    Code:
    global teleport=function(plr)
    {
    //alliance
       if(plr.GetRace() == 1)
        {
           plr.Teleport(48, -414.5, 27.1, -48.35);
                return 1;
        }
    
       if(plr.GetRace() == 2)
        {
           plr.Teleport(48, -532, 326.48, -49.67);
                return 1;
        }
    
           if(plr.GetRace() == 3)
        {
           plr.Teleport(48, -414.5, 27.1, -48.35);
                return 1;
        }
    
           if(plr.GetRace() == 4)
        {
           plr.Teleport(48, -532, 326.48, -49.67);
                return 1;
        }
    
           if(plr.GetRace() == 5)
        {
           plr.Teleport(48, -414.5, 27.1, -48.35);
        }
    //horde
           if(plr.GetRace() == 6)
        {
           plr.Teleport(48, -827.4, -227.7, -28.27);
        }
    
           if(plr.GetRace() == 7)
        {
           plr.Teleport(48, -827.4, -227.7, -28.27);
        }
    
           if(plr.GetRace() == 8)
        {
           plr.Teleport(48, -532, 326.48, -49.67);
        }
    
           if(plr.GetRace() == 10)
        {
           plr.Teleport(48, -532, 326.48, -49.67);
        }
    
           if(plr.GetRace() == 11)
        {
           plr.Teleport(48, -414.5, 27.1, -48.35);
        }
    
    };
    
    .RegisterGameObjectEvent(999670, 2, teleport);

    Gameobject LUA Teleport Different Races
  2. #2
    stoneharry's Avatar Moderator Harry


    Reputation
    1618
    Join Date
    Sep 2007
    Posts
    4,564
    Thanks G/R
    151/150
    Trade Feedback
    0 (0%)
    Mentioned
    4 Post(s)
    Tagged
    0 Thread(s)
    Gamemonkey format? Blimey that's old...

    Here are all the race ID's:

    1 - HUMAN
    2 - ORC
    3 - DWARF
    4 - NIGHTELF
    5 - UNDEAD
    6 - TAUREN
    7 - GNOME
    8 - TROLL
    9 - GOBLIN
    10 - BLOODELF
    11 - DRAENEI
    And here is the script (you will need to finish it, by filling in the rest of the races and teleport locations):

    Code:
    local Gameobject_ID = 50 -- Change this to the ID of the gameobject
    
    function CPEACAE_Cage_asdasd_OnUseZXC(pMisc, event, player)
        local race = player:GetPlayerRace()
        if (race == 1) then
        player:Teleport(48, -414.5, 27.1, -48.35)
        elseif race == 2 then
        player:Teleport(48, -532, 326.48, -49.67)
        elseif race == 3 then -- repeat for all races
        end
    end
    
    RegisterGameObjectEvent(Gameobject_ID, 4, "CPEACAE_Cage_asdasd_OnUseZXC")

  3. #3
    MikeJB's Avatar Private
    Reputation
    2
    Join Date
    Feb 2010
    Posts
    3
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by stoneharry View Post


    And here is the script (you will need to finish it, by filling in the rest of the races and teleport locations):
    Thanks a bunch, the ifs were confusing me and I'm use to doing NPCs


    RegisterGameObjectEvent(Gameobject_ID, 4, "CPEACAE_Cage_asdasd_OnUseZXC")
    Would I make that the gameobject ID? or leave it the text seeing as "Gameobject_ID = 50" is where you put the id
    Last edited by MikeJB; 10-26-2010 at 02:46 PM.

  4. #4
    stoneharry's Avatar Moderator Harry


    Reputation
    1618
    Join Date
    Sep 2007
    Posts
    4,564
    Thanks G/R
    151/150
    Trade Feedback
    0 (0%)
    Mentioned
    4 Post(s)
    Tagged
    0 Thread(s)
    It's up to you, at the moment I have it so that the variable 'Gamboejct_ID' is equal to 50. So 50 is the npcid currently, there's no need for a variable, it just makes it easier for you to alter it without getting confused.

    If you understand it, then just delete the local variable and change it to the npcid in that register part.

Similar Threads

  1. [Guide] GameObject Lua Teleport!
    By Hyldran0 in forum WoW EMU Guides & Tutorials
    Replies: 0
    Last Post: 01-16-2009, 08:17 PM
  2. Help with lua teleporter
    By Arugos in forum WoW EMU Questions & Requests
    Replies: 5
    Last Post: 09-17-2008, 09:09 AM
  3. [LUA] Teleport on spell use
    By Eponyx in forum World of Warcraft Emulator Servers
    Replies: 10
    Last Post: 05-24-2008, 10:10 AM
  4. need a gameobject which teleports players to a base
    By controlsx2 in forum World of Warcraft Emulator Servers
    Replies: 7
    Last Post: 05-22-2008, 05:38 AM
  5. Different race tattoos
    By Magnustheblack in forum WoW ME Questions and Requests
    Replies: 2
    Last Post: 03-13-2008, 06:59 PM
All times are GMT -5. The time now is 02:47 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