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

Summoner item script

tatara

New Member
Joined
Jan 1, 2023
Messages
36
Reaction score
3
GitHub
Tatara
Hi. Im working on 7.6 version server right now, and im wondering, maybe someone could help me. I need to make an items, which after using they will summon a creature.
Examle : You see 1 talon. After using this talon creature named Demon will be summoned. (Action : Right click item to summon 1x demon and item disappears ).
Thank you.
 
local summoner = Action() function summoner.onUse(player, item, fromPosition, target, toPosition, isHotkey) Game.createMonster("Demon”, fromPosition) item:remove(1) return true summoner:id(TALONID) — enter talon item id here summoner:register()

Sorry for formatting issues, I am using my iPhone at the gym.
 
local summoner = Action() function summoner.onUse(player, item, fromPosition, target, toPosition, isHotkey) Game.createMonster("Demon”, fromPosition) item:remove(1) return true summoner:id(TALONID) — enter talon item id here summoner:register()

Sorry for formatting issues, I am using my iPhone at the gym.
i added that into script, and also in actions, but ingame it says that item cannot be used, any ideas what could be wrong ?
item id to be used 2349 and monster name Big Experience
 
If your server does not support revscriptsys, then it may be a few things. Is there any other current action applied to item id 2349? Can you post an example action script from your server? I can edit it to be compatible with your current distro.
 
If your server does not support revscriptsys, then it may be a few things. Is there any other current action applied to item id 2349? Can you post an example action script from your server? I can edit it to be compatible with your current distro.
item is not applied to any other actions.
few scripts that are used on serv is like key teleporter :

function onUse(cid, item, frompos, item2, topos)
doPlayerSay(cid,"Im outta here! Chaos City Here I come",1)
player1pos = getPlayerPosition(cid)
player1 = getThingfromPos(player1pos)
if player1.itemid > 0 then
temple = {x=137, y=77, z=7}
doSendMagicEffect(topos,12)
doTeleportThing(player1.uid,temple)
doSendMagicEffect(temple,12)
doPlayerSendTextMessage(player1.uid,22,"You have used a key of power.")

end
end
 
item is not applied to any other actions.
few scripts that are used on serv is like key teleporter :

function onUse(cid, item, frompos, item2, topos)
doPlayerSay(cid,"Im outta here! Chaos City Here I come",1)
player1pos = getPlayerPosition(cid)
player1 = getThingfromPos(player1pos)
if player1.itemid > 0 then
temple = {x=137, y=77, z=7}
doSendMagicEffect(topos,12)
doTeleportThing(player1.uid,temple)
doSendMagicEffect(temple,12)
doPlayerSendTextMessage(player1.uid,22,"You have used a key of power.")

end
end
Lua:
function onUse(cid, item, frompos, item2, topos)
    player1pos = getPlayerPosition(cid)
    doCreateMonster("Big Experience", player1pos)
    doPlayerRemoveItem(cid, 2349, 1)
end
 
You have a monster with this name? Big Experience
If not then change to an existing monster name.
 
No, This monster is named Experience Bug not Big Experience.
 
in script name is also changed, sry for confusing situation :D

function onUse(cid, item, frompos, item2, topos)
player1pos = getPlayerPosition(cid)
doSummonCreature("Experience Bug", player1pos)
doPlayerRemoveItem(cid, 2349, 1)
end

script right now
 
Try this and check if there are any console errors.
Lua:
function onUse(cid, item, frompos, item2, topos)
    local player1pos = getPlayerPosition(cid)
    doSummonCreature("Experience Bug", player1pos)
    doRemoveItem(item.uid, item.type)
    return true
end
 
Last edited:
Try this and check if there are any console errors.
Lua:
function onUse(cid, item, frompos, item2, topos)
    local player1pos = getPlayerPosition(cid)
    doSummonCreature("Experience Bug", player1pos)
    doPlayerRemoveItem(cid, 2114, 1)
    return true
end
cannot use object
 
Some of the functions could be wrong or don't exist in your XML engine, It should show an error in the console.
You can also try a different monster name and see if it still doesn't work.
 
Some of the functions could be wrong or don't exist in your XML engine, It should show an error in the console.
You can also try a different monster name and see if it still doesn't work.
Server console empty
Tried to change monster to classic Demon, still not working :/
 
Lua:
--[[
    How to use?
    [item_id] = {summon = "Monster Name"}

    You can add more lines like the ones below, following the same pattern.
]]

local config = {
    [2151] = { summon = "Scarab" },
    [2112] = { summon = "Demon" },
}

function onUse(cid, item, frompos, item2, topos)
    local itemId, MESSAGE_EVENT_ADVANCE = config[item.itemid], 22
    if not itemId then return false end

    doRemoveItem(item.uid)
    local summonMonster = itemId.summon
    doSummonCreature(summonMonster, getPlayerPosition(cid))
    doPlayerSendTextMessage(cid, MESSAGE_EVENT_ADVANCE, "You have summoned " .. summonMonster)

    return true
end
 
Try this and check if there are any console errors.
Lua:
function onUse(cid, item, frompos, item2, topos)
    local player1pos = getPlayerPosition(cid)
    doSummonCreature("Experience Bug", player1pos)
    doPlayerRemoveItem(cid, 2349, 1)
    return true
end
i got this script work, i had problems with monster files.
the problem with it now, is when you use it from ground, it can be used infinite times and when you use from inventory only 1 can be summoned.
how to make it single use even from floor ?
 
Back
Top