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

I have doubts spells conjureItem

Mateus Robeerto

Excellent OT User
Joined
Jun 5, 2016
Messages
1,337
Solutions
71
Reaction score
697
Location
ლ(ಠ益ಠლ)
I looked at the script and I still didn't understand it very well.. I tested it in the game and it gave an error

Lua Script Error: [Spell Interface]
data/spells/scripts/conjuring/fire_field_rune.lua:eek:nCastSpell
data/spells/scripts/conjuring/fire_field_rune.lua:2: attempt to call method 'conjureItem' (a nil value)
stack traceback:
[C]: in function 'conjureItem'
data/spells/scripts/conjuring/fire_field_rune.lua:2: in function <data/spells/scripts/conjuring/fire_field_rune.lua:1>
Lua:
function onCastSpell(creature, variant)
    return creature:conjureItem(2260, 2261, 3)
end

Can someone tell me how this magic shit works?

TFS 1.5 NEKIRO , that function "function="conjureRune">" were removed?
 
missing method/function
thanks it works well but I had already finished it almost here hahaa, look I made the script very simple

Lua:
function onCastSpell(creature, variant)
    local requiredItemID = 2260
    local newItemID = 2287
    local newItemCount = 10

    local player = Player(creature)
    local hands = player:getSlotItem(CONST_SLOT_LEFT)
    local backpack = player:getItemById(requiredItemID)

    if hands and hands:getId() == requiredItemID then
        hands:transform(newItemID, newItemCount)
    elseif backpack then
        local count = math.min(backpack:getCount(), newItemCount)
        backpack:remove(count)
        player:addItem(newItemID, newItemCount)
    else
        player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "Voce precisa ter pelo menos 1 adori blank para lancar a magia.")
        return false
    end

     player:getPosition():sendMagicEffect(CONST_ME_MAGIC_GREEN)
    local itemName = getItemNameById(newItemID)
    player:sendTextMessage(MESSAGE_INFO_DESCR, "Voce lancou a magia e obteve " .. newItemCount .. " " .. itemName .. ".")
    return true
end

I scripted one by one....🤨
 
Back
Top