Nebula Posted December 24, 2019 Share Posted December 24, 2019 How to determine the gender of the character? Link to comment Share on other sites More sharing options...
Axezombie Posted December 24, 2019 Share Posted December 24, 2019 well same as IRL, undress him/her Maris and Nebula 2 Link to comment Share on other sites More sharing options...
Nebula Posted December 24, 2019 Author Share Posted December 24, 2019 (edited) 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 December 24, 2019 by Nebula Link to comment Share on other sites More sharing options...
ATPHHe Posted March 18, 2020 Share Posted March 18, 2020 (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. https://projectzomboid.com/modding/zombie/Lua/LuaManager.GlobalObject.html https://projectzomboid.com/modding/zombie/Lua/LuaManager.GlobalObject.html#getPlayer-- "isFemale()" is a function of "IsoPlayer" which is inherited from the "IsoGameCharacter" class. https://projectzomboid.com/modding/zombie/characters/IsoPlayer.html "IsoGameCharacter" https://projectzomboid.com/modding/zombie/characters/IsoGameCharacter.html#isFemale-- 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 end function PlayerFunctions.isFemale2() return getPlayer():isFemale() end local function isFemale() return getPlayer():isFemale() end function isFemaleGlobalFunction() return getPlayer():isFemale() end local function printPlayerGender() print("IsFemale? --> " .. getPlayer():isFemale()) end function printPlayerGenderGlobalFunction() print("IsFemale? --> " .. getPlayer():isFemale()) end PlayerFunctions.lua Edited March 18, 2020 by ATPHHe Edited code. Nebula 1 Link to comment Share on other sites More sharing options...
Nebula Posted March 18, 2020 Author Share Posted March 18, 2020 For a long time irrelevant, I figured out ... but thanks anyway. ATPHHe 1 Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now