No categories assigned

LUA:GetGender

Revision as of 15:34, 17 October 2012 by Jabantiz (talk | contribs) (Created page with "= LUA Functions: GetGender() = Returns the current gender id for the given spawn. ==== Syntax ==== var = GetGender(param1) ==== Parameters ==== ; Required - ''param1'' (Spaw...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

LUA Functions: GetGender()

Returns the current gender id for the given spawn.


Syntax

var = GetGender(param1)


Parameters

Required - param1 (Spawn)
param1 is the spawn whos gender we are checking


Usage

function hailed(NPC, Spawn)
    if GetGender(Spawn) == 1 then
        Say(NPC, "You're male!")
    else
        Say(NPC, "You're female!")
    end
end

This makes the NPC respond to the player who hails it with their gender.


Notes

0 = Female 1 = Male