Could somebody give me some tips how to add to this script that monster isn't moving? Only when he see player with set storage?
Code:
local monster = 'Wolf' -- name
local stor = 8000 -- storage
function onCombat(cid, target)
if (isPlayer(cid)) then
if (isMonster(target) and (getCreatureName(target) == monster and (getPlayerStorageValue(cid, stor) ~= 2))) then
return false
end
elseif (isMonster(cid)) then
if (isPlayer(target) and (getPlayerStorageValue(target, stor) ~= 2) and doCreatureSetNoMove(cid, false)) then
return false
end
end
return true
end
function onKill(cid, target)
if isMonster(target) and getCreatureName(target) == monster and getPlayerStorageValue(cid, stor) == 2 then
setPlayerStorageValue(cid, stor, 3)
end
return true
end