• 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!

Solved Function onCombat(player, target) TFS 1.1

Critico

Sexy
Joined
Mar 25, 2010
Messages
370
Reaction score
176
Hello!

exist this function:

onCombat(player, target)

for TFS 1.1? if not exist, what function should I use?
 
need a function that players with same storages not attack team mates!

not work this:

Code:
function Creature:onTargetCombat(target)
    if not self then return true end
    if self:isPlayer() and target:isPlayer() and self:getStorageValue(15001) == 1 and target:getStorageValue(Lib_Battle_Info.TeamOne.storage) == 1 then
        self:sendCancelMessage("You may not attack your team mates.")
        return false
    end
    return true
end

return message, but can attack team mates
 
You have to return RETURNVALUE_ values when using Creature.onTargetCombat.

e.g
Code:
    if something then
        return RETURNVALUE_YOUMAYNOTATTACKTHISPLAYER
    end
 
Back
Top