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

Lua Spells hit players with open hand

Niloahs

Well-Known Member
Joined
Feb 10, 2020
Messages
111
Solutions
1
Reaction score
82
im wondering how to make spells only hit players with closed hand
.SecureMode.png
 
Solution
Maybe try add those to your data\events\scripts\creature.lua
Creature:onAreaCombat method and onTargetCombat method
Not tested.
Lua:
            if self:hasSecureMode() then
                return RETURNVALUE_YOUMAYNOTATTACKTHISPLAYER
            end
            if player:hasSecureMode() then
                return RETURNVALUE_YOUMAYNOTATTACKTHISPLAYER
            end
Maybe try add those to your data\events\scripts\creature.lua
Creature:onAreaCombat method and onTargetCombat method
Not tested.
Lua:
            if self:hasSecureMode() then
                return RETURNVALUE_YOUMAYNOTATTACKTHISPLAYER
            end
            if player:hasSecureMode() then
                return RETURNVALUE_YOUMAYNOTATTACKTHISPLAYER
            end
 
Solution
I tried and didnt work, so i search on global data pack and found this code and worked, i will post if anyone need :)

just put in onTargetCombat


Lua:
if ADVANCED_SECURE_MODE ~= 0 then
        if self:isPlayer() and target:isPlayer() then
            if self:hasSecureMode() then
                return RETURNVALUE_YOUMAYNOTATTACKTHISPLAYER
            end
        end
    end
    return true
end


thanks for the help moustafa :)
 
Back
Top