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

TFS 1.X+ stop atk null IP

Pedrook

Advanced OT User
Joined
May 24, 2009
Messages
442
Solutions
3
Reaction score
183
Location
Brazil
I'm trying to put it to when the player has the ip null, 0.0.0.0 it stops attacking the bixos, because when you exit the beat it continues to beat. I was told I would have a way to add events / creatures


Lua:
if target:getIp() == 0 then -- If player is disconnected, monster shall ignore to attack the player
                if protectionStorage <= 0 then
                    addEvent(removeCombatProtection, 30 * 1000, target.uid)
                    target:setStorageValue(Storage.combatProtectionStorage, 1)
                elseif protectionStorage == 1 then
                    self:searchTarget()
                    return RETURNVALUE_YOUMAYNOTATTACKTHISPLAYER
                end

pZujHzK.png


src font: flaviiojr/otxserver-new-1
 
Last edited:
monster:setTarget(nil)
or if you're using it inside of onTargetCombat use self:setTarget(nil) if self is monster
 
Solution
Back
Top