• 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!
  • New resources must be posted under Resources tab. A discussion thread will be created automatically, you can't open threads manually anymore.

MoveEvent Add item monster appears

Rufo

New Member
Joined
Jan 9, 2008
Messages
251
Reaction score
1
I made this a lot ago, it just can be used 1 time per reset, if your server doesnt save the global storage.

to make sure on TFS go to config.lua and search for:
Code:
	saveGlobalStorage = false
if its false its ok

Just put the actionid that you want on x tile. After puting the item on it the monster appear on X position. And it cant appear until server reset
Lua:
function onAddItem(moveitem, tileitem, position, cid)

local monsterpos = {x=491, y=1168, z=7} -- position of the monster
local storage = 54697 -- The global storage used
local itemid = 2136 -- itemid you need to put on the tile.
local monster = "Demon" -- Monster
local globalstorage = getGlobalStorageValue(storage) -- No touch plx :)

	if moveitem.itemid == itemid then
		if globalstorage == -1 then
			doRemoveItem(moveitem.uid, 1)
				doSummonCreature(monster, monsterpos)
				doSendMagicEffect(monsterpos,12)
				setGlobalStorageValue(globalstorage, 1)
			end
end
	return TRUE
end
movements.xml
Code:
		<movevent type="AddItem" tileitem="1" actionid="54697" event="script"  value="scriptname.lua"/>



BY NARHUTO (u can this every time u configure it, not like mine every reset)
Lua:
local last, pid = 0, 0

local monsterpos = {x = 491, y = 1168, z = 7}
local itemid = 2136
local monster = "Demon"
local delay = 60 * 60 -- 1 hour

function onAddItem(moveitem, tileitem, position, cid)
    if ((os.time() - last) < delay)  or isCreature(pid) then
        return true
    end
    
    if (moveitem.itemid == itemid) then
        doRemoveItem(moveitem.uid)
        local summon = doSummonCreature(monster, monsterpos)
        doSendMagicEffect(monsterpos, 12)
        last, pid = os.time(), summon
    end
    return true
end

I have modified it a little bit, if doesnt work tell me cuz i havent tested it after the modifications.
 
Last edited:
very nice, but you should check if tile is protection zone
 
Why one time only? for bosses :p, what if the item id is like a vial or something and then a player just adds a lot of items, then there will be a lot of monsters xD
 
O M G

You can added items no noob qestions :
ye why only one time?
why only one time?

OMG
you dont no 0 about scripts
 
We know 0 about scripts? You must be the funny guy!
Excuse me if I understood you wrong though.. Your english was like.. ye. ;p
 
heh you have to not understand my text I don't tallk to only you biceuse I see you have bin write some scripts [ what a rest ?? ]
 
its useless make it one time per reset, and its even useless use global storages.

Lua:
local last, pid = 0, 0

local monsterpos = {x = 491, y = 1168, z = 7}
local itemid = 2136
local monster = "Demon"
local delay = 60 * 60 -- 1 hour

function onAddItem(moveitem, tileitem, position, cid)
    if ((os.time() - last) < delay)  or isCreature(pid) then
        return true
    end
    
    if (moveitem.itemid == itemid) then
        doRemoveItem(moveitem.uid)
        local summon = doSummonCreature(monster, monsterpos)
        doSendMagicEffect(monsterpos, 12)
        last, pid = os.time(), summon
    end
    return true
end
 
Its not useless, what if its a stable servers that deletes the global storage everyday?, that should be nice :p, works 4 me, but i'll put your script on the main post, thank you
 
Back
Top