• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

Looking for an "isSummon" function?

jerryb1988

Member
Joined
Mar 10, 2008
Messages
79
Reaction score
5
I'm not really sure on how to go about this one so I'm going to make a request. I'm looking for a function where i can type like...
Code:
if isSummon(target) == true then,
     code
else
     code
end

I'm using TFS 0.3.4 PL2. I read in the LUA_FUNCTIONS list:

getCreatureMaster(cid)
Info
This function checks creature master. Its used for summoned creatures, to check who has summoned it.

Returns
Creature master cid if found, otherwise self cid.

so i think it would be something like:
Code:
if getCreatureMaster(target) == ??creatureid??
     return FALSE -- Not summon
else
     return TRUE -- Is a summon
end

how do i do get the ??creatureid?? part? // how do i get a creatures id?

This is probably the dumbest, easiest, thing on the planet and I'm probably overlooking something simple and stupid... so I apologize now.
 
hehe, as you see this function returns self id if it have no master (So its not summon)

So ;)

Code:
if getCreatureMaster(target) == target then
     return FALSE -- Not summon
else
     return TRUE -- Is a summon
end
 
Last edited:
I feel like an idiot because i had == target.cid and it didnt work... As I said, I figured it would be something really simple. Thank you though, and ++rep for you.
 
Back
Top