GetFaction (lua) menu

User Tag List

Results 1 to 3 of 3
  1. #1
    jay77's Avatar Member
    Reputation
    1
    Join Date
    Jan 2009
    Posts
    55
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    GetFaction (lua)

    int luaUnit_GetFaction(lua_State * L, Unit *ptr);

    How do I use this in a lua teleporter? I want to get the faction then if faction == (horde) (alliance) they see different menus. I don't know how to implement this into the script =[.

    And off the top of your head, if you know the faction id (if it uses id's) what are they for both. Thanks +Rep!

    GetFaction (lua)
  2. #2
    Vision1000's Avatar Member
    Reputation
    104
    Join Date
    Jun 2008
    Posts
    122
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I'm not sure what 'GetFaction()' would return if used on a player, But if your curious you can try...
    Code:
    function Portal_OnUse(Unit, Event, player)
        print(player:GetFaction().." Is the current players faction")
    end
    Then figure out what it returns as and go from there.

    Otherwise you can do it by player race. like so;

    Code:
    local race = player:GetPlayerRace()
    
    	if race==1 or race==3 or race==4 or race==7 or race==11 then
                    -- Will execute this code if player is alliance.
    	else
    		-- Will execute this code if player is horde.
    	end
    Hope that helps =).
    Last edited by Vision1000; 08-10-2009 at 06:38 PM.

  3. #3
    Sounddead's Avatar Contributor
    Reputation
    160
    Join Date
    Sep 2007
    Posts
    1,126
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    GetFaction returns either a 1 or a 0. 0 being alliance I think. Don't use get race, its a retarded way of going about trying to find which alliance the player is from.

    I live in a shoe

Similar Threads

  1. [Guide] Lua Scripting Guide is here [Updating]
    By Illidan1 in forum WoW EMU Guides & Tutorials
    Replies: 93
    Last Post: 11-04-2008, 06:56 PM
  2. New LUA Scripts
    By 777devil777 in forum World of Warcraft Emulator Servers
    Replies: 8
    Last Post: 11-26-2007, 05:58 PM
  3. Lua Ascent Script Documentation
    By latruwski in forum World of Warcraft Emulator Servers
    Replies: 0
    Last Post: 11-26-2007, 12:42 PM
  4. LUA Refrences
    By 777devil777 in forum World of Warcraft Emulator Servers
    Replies: 1
    Last Post: 11-22-2007, 08:09 PM
All times are GMT -5. The time now is 09:03 AM. 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