Hi, is there anyone able to add to this script functions that immobilizes a monster in place, and when the player is required storage allows him to move?
The script itself works, because if we do not have specific storage we can not hit Wolf and he us ... but it comes to us; /
The script itself works, because if we do not have specific storage we can not hit Wolf and he us ... but it comes to us; /
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) == 1 or 3))) then
return false end
elseif (isMonster(cid)) then
if (isPlayer(target) and (getPlayerStorageValue(target, stor) == 1 or 3)) 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