• 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!
  • 2026 staff recruitment is open! Check it out and consider applying!

Lua Immobilize Monster

Black123

New Member
Joined
Nov 17, 2011
Messages
32
Reaction score
0
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
 
Back
Top