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

Secure mode to use UE

dewral

Veteran OT User
Joined
Dec 4, 2019
Messages
343
Solutions
10
Reaction score
351
Hello im using something like this in events to stop players geting skull from AOE damage:

Lua:
function Creature:onTargetCombat(target)
    if hasEventCallback(EVENT_CALLBACK_ONTARGETCOMBAT) then
        return EventCallback(EVENT_CALLBACK_ONTARGETCOMBAT, self, target)
    elseif self:isPlayer() and target:isPlayer() and self:hasSecureMode() then
    return RETURNVALUE_YOUMAYNOTATTACKTHISPLAYER
    else
target:registerEvent("Vocations")
        return RETURNVALUE_NOERROR
    end
end

It's working as it supposed to be but when im using this my fire fields don't working after stepping im getting this

OTLLAND.png


Lua:
    elseif attacker and self:isPlayer() and target:isPlayer() and self:hasSecureMode() then

    return RETURNVALUE_YOUMAYNOTATTACKTHISPLAYER
Tried just like that and fields working but now the secure mode isn't working properly and i can damage players from UE.
Any help? :D
 
Just verify if self exists, on stepping a field 'self' becomes nil if there is no owner/self casted
 
Just verify if self exists, on stepping a field 'self' becomes nil if there is no owner/self casted
I'm sorry for being dumb but how to do that xD

Lua:
    elseif not self then
    return false
    elseif self:isPlayer() and target:isPlayer() and self:hasSecureMode() then
        return RETURNVALUE_YOUMAYNOTATTACKTHISPLAYER
I did it like this, seems to work but i have to check everything xD
 
Lua:
elseif self and self:isPlayer() and target:isPlayer() and self:hasSecureMode() then
;P
 
Solution
Back
Top