Moj mistrz
Monster Creator
Hello as the title says, but that's not all and it would be too long for a thread title. Basically I want my script to check whether:
a) attacked monster is a summon
b) if it's a summon, does it belong to me or any member of my party or guild
c) if yes then return YOUMAYNOTATTACKTHISPLAYER
That's the code I've got for now. It checks if my target is in my party or guild, but I have no idea how to write it to check if the summon belong to me or any member of my party/guild.
Thanks for any help.
a) attacked monster is a summon
b) if it's a summon, does it belong to me or any member of my party or guild
c) if yes then return YOUMAYNOTATTACKTHISPLAYER
That's the code I've got for now. It checks if my target is in my party or guild, but I have no idea how to write it to check if the summon belong to me or any member of my party/guild.
Code:
if self:isPlayer() and target:isPlayer() then
local party, guild = self:getParty(), self:getGuild()
if party or guild then
local targetParty, targetGuild = target:getParty(), target:getGuild()
if targetParty and targetParty == party or targetGuild and targetGuild == guild then
return RETURNVALUE_YOUMAYNOTATTACKTHISPLAYER
end
end
end
Last edited: