• 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 0.X SECURE MODE -- "fist" on/off

@Marko999x I'm using tfs 1.5 nekiro downgrade 8.60, do you know what to do? How to introduce the system secure mode?

Yeah :D
LUA:
    registerMethod("Player", "hasChaseMode", LuaScriptInterface::luaPlayerHasChaseMode);
    registerMethod("Player", "hasSecureMode", LuaScriptInterface::luaPlayerHasSecureMode);
    registerMethod("Player", "getFightMode", LuaScriptInterface::luaPlayerGetFightMode);


Try this:
LUA:
local ec = EventCallback

ec.onTargetCombat = function(self, target)
    if self and self:isMonster() then
        return true
    end
    if self and self:hasSecureMode() then
        if target:isPlayer() then
            return RETURNVALUE_YOUMAYNOTATTACKTHISPLAYER
        end
    end

    return RETURNVALUE_NOERROR
end

ec:register()
 
this i have to add in data/script
LUA:
local ec = EventCallback

ec.onTargetCombat = function(self, target)
    if self and self:isMonster() then
        return true
    end
    if self and self:hasSecureMode() then
        if target:isPlayer() then
            return RETURNVALUE_YOUMAYNOTATTACKTHISPLAYER
        end
    end

    return RETURNVALUE_NOERROR
end

ec:register()


what about this?
Code:
    registerMethod("Player", "hasChaseMode", LuaScriptInterface::luaPlayerHasChaseMode);
    registerMethod("Player", "hasSecureMode", LuaScriptInterface::luaPlayerHasSecureMode);
    registerMethod("Player", "getFightMode", LuaScriptInterface::luaPlayerGetFightMode);

sorry for newbish post
 
this i have to add in data/script
LUA:
local ec = EventCallback

ec.onTargetCombat = function(self, target)
    if self and self:isMonster() then
        return true
    end
    if self and self:hasSecureMode() then
        if target:isPlayer() then
            return RETURNVALUE_YOUMAYNOTATTACKTHISPLAYER
        end
    end

    return RETURNVALUE_NOERROR
end

ec:register()


what about this?
Code:
    registerMethod("Player", "hasChaseMode", LuaScriptInterface::luaPlayerHasChaseMode);
    registerMethod("Player", "hasSecureMode", LuaScriptInterface::luaPlayerHasSecureMode);
    registerMethod("Player", "getFightMode", LuaScriptInterface::luaPlayerGetFightMode);

sorry for newbish post

It's just the functions. You can ignore it :D
 
Go to data/events/events.xml

<event class="Creature" method="onTargetCombat" enabled="0" />

Change it to 1
 
You don't need to add anything. Just add what I sent and you will be fine :D
Tested it and it works
 
Yes we talk about that

Add me on discord so I can help you easier :D markotibia

Edit: fixed it in discord.. Problem was a line in his creature.lua that blocked the execute of onTargetCombat :D
 
Last edited:
Back
Top