Jump to content

Beginner question about using the java docs - getSpecificPlayer(0)


toastonrye

Recommended Posts

I'm trying to wrap my head around the java docs, how to work with them. Looking at getSpecificPlayer(0), it looks like IsoPlayer is returned, https://projectzomboid.com/modding/zombie/characters/IsoPlayer.html

 

Question 1: How do I know which getX() and getY() they are using?

-Methods inherited from class zombie.iso.IsoMovingObject

-Methods inherited from interface zombie.chat.ChatElementOwner

 

I had also tried doing a local targeted = tostring(plr:targetedByZombie()).

Referencing a snipped of code, from another mod, plus the targeted variable stuff I added:

 

Question 2: How do I determine what functions can be used with plr: ?

 

local plr = getSpecificPlayer(0);
if not plr then return 1; end

local posX = math.floor(plr:getX());
local posY = math.floor(plr:getY());
local targeted = plr:targetedByZombie(); -- error
local txt1 = "x:" .. posX .. " y:" .. posY .. " t: " .. targeted; 

 

edit:

My question was answered in the Discord, I was using a field not a function. The function should have been :isTargetedByZombie()

Edited by toastonrye
Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...