• 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 Disallow player to attacking some players

Warmix

New Member
Joined
Mar 28, 2010
Messages
18
Solutions
1
Reaction score
2
Hello,
I want to disallow player to attacking other palyers with e.g. StorageValue==1000. Using TFS 0.4 I might put this codition in creatrurescripts, but now I'm using TFS 1.2 and doCombat doesn't exist in creaturescripts. Where can I do something like that?
 
Solution
in events/creature.lua

Lua:
function Creature:onTargetCombat(target)
if self:isPlayer() and target:isPlayer() then
  if target:getStorageValue(1111) >= 1 then
    return RETURNVALUE_YOUMAYNOTATTACKTHISPLAYER
  end
end
   return true
end
in events/creature.lua

Lua:
function Creature:onTargetCombat(target)
if self:isPlayer() and target:isPlayer() then
  if target:getStorageValue(1111) >= 1 then
    return RETURNVALUE_YOUMAYNOTATTACKTHISPLAYER
  end
end
   return true
end
 
Solution
Back
Top