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

Attack monster

Erexo

Kage
Premium User
Joined
Mar 27, 2010
Messages
743
Solutions
5
Reaction score
200
Location
Pr0land
GitHub
Erexo
Hello,
im looknig for a script, you can only attack monster (and monster you) when you have a X stroage valute...

And when you kill this monster, you recive a X stroage valute...

(tfs 0.3.1)

Someone can help me? ^^

Thanks...
 
LUA:
local mobs = {
    ["rat"] = 2334,
    ["demon"] = 2335
}
function onAttack(cid, target)
    if mobs[getCreatureName(cid):lower()] and isMonster(cid) and isPlayer(target) and getPlayerStorageValue(target, mobs[getCreatureName(cid):lower()]) == 1 then
        return false
    elseif mobs[getCreatureName(target):lower()] and isMonster(target) and isPlayer(cid) and getPlayerStorageValue(cid, mobs[getCreatureName(target):lower()]) == 1 then
        return false
    end
    return true
end
Maybe something like that?
 
Last edited:
LUA:
local mobs = {
    ["rat"] = 2334,
    ["demon"] = 2335
}
function OnAttack(cid, target)
    if mobs[getCreatureName(cid):lower()] and isMonster(cid) and isPlayer(target) and getPlayerStorageValue(target, mobs[getCreatureName(cid):lower()]) == 1 then
        return false
    elseif mobs[getCreatureName(target):lower()] and isMonster(target) and isPlayer(cid) and getPlayerStorageValue(cid, mobs[getCreatureName(target):lower()]) == 1 then
        return false
    end
    return true
end
Maybe something like that?

LUA:
function onAttack
Instead of
LUA:
function OnAttack
:p
 
Back
Top