Jump to content
Sign in to follow this  

Male and female characters

Recommended Posts

2 hours ago, Axezombie said:

well same as IRL, undress him/her

Your jokes are inappropriate here.
I need help with the code.


And by the way, yes, it would be more interesting if the characters were completely undressable, and underwear was dressed as well as clothes.

Edited by Nebula

Share this post

Link to post
Share on other sites
Posted (edited)

Use the function "getPlayer():isFemale()"

There's more ways to get some player's gender, but this is one way.


"getPlayer()" is a global Project Zomboid function that returns an "IsoPlayer" object that is the client's character.





"isFemale()" is a function of "IsoPlayer" which is inherited from the "IsoGameCharacter" class.









Here's some example functions that use these classes and their functions.

This only returns if the client's gender is female as true or false.


The code has to be put inside the client folder in "..\media\lua\client" on some lua file.

Any questions feel free to ask me.

PlayerFunctions = {}

    Returns a boolean true if the player is female.
    Returns a boolean false if the player is male.
    Requirements: This code must be run under the client folder inside "..\media\lua\client" inside some lua file.
function PlayerFunctions.isFemale()
    local playerObj = getPlayer()
    local isFemale = playerObj:isFemale()
    return isFemale

function PlayerFunctions.isFemale2()
    return getPlayer():isFemale()

local function isFemale()
    return getPlayer():isFemale()

function isFemaleGlobalFunction()
    return getPlayer():isFemale()

local function printPlayerGender()
    print("IsFemale? --> " .. getPlayer():isFemale())

function printPlayerGenderGlobalFunction()
    print("IsFemale? --> " .. getPlayer():isFemale())





Edited by ATPHHe
Edited code.

Share this post

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

  • Create New...