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

Use item x monster spawns

psychosisneamia

~Beginner~
Joined
Jun 7, 2012
Messages
162
Reaction score
7
Hello, I have a request for you lovely people. I need a script that when you use a certain item a monster is spawned. The script i used removes the item but no monster spawns

Here is the script I tried to make.

function onUse(cid, item, fromPosition, itemEx, toPosition)
doCreateMonster("Giant Spider",toPosition)
doRemoveItem(item.uid,1)
return TRUE
end

Can anyone fix it for me ;D I looked in the search bar and only found scripts where it summons a monster to a X pos which i don't want. I want this monster to spawn to the exact location you use the item!

Thanks!!!
 
Code:
function onUse(cid, item, fromPosition, itemEx, toPosition)
doCreateMonster("Giant Spider", getPlayerPosition(cid))
doRemoveItem(item.uid, 1)
end
return TRUE
end
 
Would this work?
Code:
function onUse(cid, item, fromPosition, itemEx, toPosition)
doCreateMonster("Giant Spider", getPlayerPosition(cid))
doRemoveItem(item.uid, 1)
return TRUE
end
 
PHP:
function onUse(cid, item, fromPosition, itemEx, toPosition)
doCreateMonster("Giant Spider", getPlayerPosition(cid))
doRemoveItem(item.uid, 1)
return true
end
 
TFS 1.0
Code:
local player = Player(cid)
player:addMana(-player:getMana())
0.3/0.4
Code:
doCreatureAddMana(cid, -getCreatureMana(cid))
 
Code:
function onUse(cid, item, fromPosition, itemEx, toPosition)
doCreateMonster("Giant Spider", getPlayerPosition(cid))
doRemoveItem(item.uid, 1)
doCreatureAddMana(cid, -getCreatureMaxMana(cid))
return TRUE
end
 
I tried, is there a way to make sure you have to have FULL mana to use it?

EDIT: or would it be easier to just add and exhaust to it?
 
Last edited:
I tried, is there a way to make sure you have to have FULL mana to use it?

EDIT: or would it be easier to just add and exhaust to it?
something like this
Code:
local exhaust = createConditionObject(CONDITION_EXHAUST)
setConditionParam(exhaust, CONDITION_PARAM_TICKS, (getConfigInfo('timeBetweenExActions') + 2000))

function onUse(cid, item, fromPosition, itemEx, toPosition)
if hasCondition(cid, CONDITION_EXHAUST) == TRUE then
        doPlayerSendDefaultCancel(cid, RETURNVALUE_YOUAREEXHAUSTED)
        return TRUE
    end
doCreateMonster("Giant Spider", getPlayerPosition(cid))
doRemoveItem(item.uid, 1)
doCreatureAddMana(cid, -getCreatureMaxMana(cid))
doAddCondition(cid, exhaust)
return TRUE
end

if you want more or less exhaust change the + 2000
 
Last edited:
Would there be a way to make this work so it summons a monster to a select location X, Y, Z?

I use Crying Damson 0.3.7_SVN (TFS 1.0)
 
Back
Top