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

Concrete monster ignore you, if you've xxx storage

Krazy

New Member
Joined
Apr 12, 2009
Messages
8
Reaction score
1
Location
Poland
Hello,

is it possible to do something like in the topic? F.e. you have done the quest, gain 1001 storage (1) and f.e. orcs don't attack you. Kinda like GM ghost, but only for specific monster.
 
Never done this before, but I had a stab at it:

Lua:
function onCombat(cid, target)
local storage = 1337
local monster = "Orc"
if getPlayerStorageValue(cid, storage) == true then 
if getCreatureName(cid, monster) and getDistanceBetween(cid, monster) <= 9 then
doMonsterChangeTarget(cid, monster)
end 
end
return true
end
 
I think it'd only work if there's another player around aswell without the storage, as it says doMonsterChangeTarget. Don't know the function for "ignorePlayer" though. Would be a cool script though! I'd defenetly use it.
 
Optus said:
Sweat and hard work that I'm basically taking

Well if you don't want to do it in a round-about way, this might work (untested):
Lua:
function onCombat(cid, target)
   local storage = 1001
   local monster = "Orc"

   --if the thing being attacked is a player with the storage, and the attacker is an "Orc", then don't do combat
   if (getPlayerStorageValue(target.uid, storage) == 1) then 
      if (getCreatureName(cid) == monster) then
         return false
      end
   end

   return true
end
 
Back
Top