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

Summon monster at use item

Dankoo

Active Member
Joined
Sep 4, 2010
Messages
1,007
Reaction score
27
I want to make a script, in wich when the player uses an statue, an monster is summoned, any ideas?

Thanks
 
PHP:
function onUse(cid, item, frompos, item2, topos)

local config = {
actionid = 4444, -- put here action id of your statue
itemid = 5000, -- put here item id of your statue
monster = "Rat" -- put here monster name
}

local dir = getPlayerLookDir(cid)
local pos = getPlayerPosition(cid)

if(dir==1)then
	pos.x = pos.x + 1
elseif(dir==2)then
	pos.y = pos.y + 1
elseif(dir==3)then
	pos.x = pos.x - 1
elseif(dir==0)then
	pos.y = pos.y - 1
end

if item.itemid == config.itemid and item.actionid == config.actionid then
		doCreateMonster(config.monster, pos)
end

return LUA_NO_ERROR
end

if u want script where a each player can use it only once or in few time pm me
 
Last edited:
thanks, it's working, pm sent, hope u don't charge lol

thanks again!

-- edit --

nevermind, got it working!

Thanks a lot for your help, ignore my pm

if you need anything, ask me and I'll do my best to help, rep+
 
Last edited:
Back
Top