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

If monster target is player then spaqn item

Nekiro

retired
TFS Developer
Joined
Sep 7, 2015
Messages
2,759
Solutions
127
Reaction score
2,279
Hello, like in topic is it possible? I want to make monster spawn item under yourself(monster) when he is targeting player. It should spawn randomly something like 1h cooldown between each spawn for each same monster on map.

Tfs 1.2
 
Then, can you help me with that?
here a sample
Code:
function onThink(creature)
    local monster = creature:getMonster()
    local GlobalStorage = 673003
    if not monster or monster:getName():lower() ~= 'YOURMONSTER' then
        return true
    end
    if Game.getStorageValue(GlobalStorage) >= 1 then
        return true
    end
    Game.createItem(ITEMID, COUNT, monster:getPosition())
    Game.setStorageValue(GlobalStorage, 1)
    addEvent(Game.setStorageValue, 60 * 60 * 1000, GlobalStorage, 0)
end
 
Back
Top