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

error dummy

carlinhous1996

New Member
Joined
Apr 14, 2022
Messages
54
Reaction score
3
could someone help me with this script?
it is giving this error
I made a small change because when I trained inside the house and the dummy moved, the training continued, even without the dummy it's more there.

[Error - Action Interface]
data/actions/scripts/drummy.lua:eek:nUse
Description:
data/actions/scripts/drummy.lua:34: attempt to call global 'getThingFromPosition' (a nil value)
stack traceback:
data/actions/scripts/drummy.lua:34: in function 'exerciseDummyTrainEvent'
data/actions/scripts/drummy.lua:101: in function <data/actions/scripts/drummy.lua:72>
Lua:
---@ Create by Sarah Wesker | Tested Version: TFS 0.4
---@ list of training dummies.
local dummies = {
    [1443] = { skillRate = 0.5, skillSpeed = 0.1 },
    [5787] = { skillRate = 0.5, skillSpeed = 0.1 }
}

---@ Global training parameters of the system.
local staminaTries = 1 --# on minutes
local skillTries = 1 --# tries by blow
local skillSpent = function() return math.random(425, 575) end --# mana consumed by blow
local slotForUse = CONST_SLOT_AMMO

---@ list of weapons to train.
local weapons = {
    [7864] = { shootEffect = CONST_ME_HITAREA, shootDistEffect = CONST_ANI_SMALLEARTH, skillType = SKILL_MAGLEVEL }, -- magicLevel Dru
    [7879] = { shootEffect = CONST_ME_HITAREA, shootDistEffect = CONST_ANI_ENERGY, skillType = SKILL_MAGLEVEL }, -- magicLevel Sor
    [2426] = { shootEffect = CONST_ME_HITAREA, shootDistEffect = CONST_ANI_SPEAR, skillType = SKILL_DISTANCE }, -- distance
    [7744] = { shootEffect = CONST_ME_HITAREA, skillType = SKILL_SWORD }, -- sword
    [7750] = { shootEffect = CONST_ME_HITAREA, skillType = SKILL_AXE }, -- axe
    [7758] = { shootEffect = CONST_ME_HITAREA, skillType = SKILL_CLUB } -- club
}

---@ EDTE is the global event table to control the system correctly.
if not EDTE then EDTE = {} end

---@ functions to assign or obtain the training status of a player.
function getPlayerExerciseTrain(cid) return EDTE[cid] or false end
function setPlayerExerciseTrain(cid, status) EDTE[cid] = status return status end

---@ local training function.
local function exerciseDummyTrainEvent(params, weapon)
    if isPlayer(params.cid) then
        local foundDummy = getThingFromPosition(params.dummyPos)
        if foundDummy.itemid ~= params.dummyId then
            doPlayerSendTextMessage(params.cid, MESSAGE_EVENT_ADVANCE, "The training dummy moved.")
            return setPlayerExerciseTrain(params.cid, nil)
        end
        local item = getPlayerSlotItem(params.cid, slotForUse)
        local playerPosition = getCreaturePosition(params.cid)
        if getDistanceBetween(playerPosition, params.currentPos) == 0 and item.itemid == params.itemid then
            local weaponCharges = getItemAttribute(item.uid, "charges") or getItemInfo(params.itemid).charges
            local reloadMs = getVocationInfo(getPlayerVocation(params.cid)).attackSpeed * params.dummy.skillSpeed
            if weaponCharges >= 1 then
                doItemSetAttribute(item.uid, "charges", weaponCharges -1)
                if weapon.shootDistEffect then doSendDistanceShoot(playerPosition, params.dummyPos, weapon.shootDistEffect) end
                if weapon.shootEffect then doSendMagicEffect(params.dummyPos, weapon.shootEffect) end
                if weapon.skillType == SKILL_MAGLEVEL then
                    doPlayerAddSpentMana(params.cid, (skillSpent() * params.dummy.skillRate) * getConfigValue("rateMagic"))
                else
                    doPlayerAddSkillTry(params.cid, weapon.skillType, (skillTries * params.dummy.skillRate) * getConfigValue("rateSkill"))
                end
                local currentStamina = getPlayerStamina(params.cid)
                doPlayerSetStamina(params.cid, currentStamina + staminaTries)
                if weaponCharges <= 1 then
                    exerciseDummyTrainEvent(params, weapon)
                else
                    setPlayerExerciseTrain(params.cid, addEvent(exerciseDummyTrainEvent, reloadMs, params, weapon))
                end
                return true
            else
                doRemoveItem(item.uid)
                doPlayerSendTextMessage(params.cid, MESSAGE_EVENT_ADVANCE, "Your exercise weapon has expired, therefore your training too.")
            end
        else
            doPlayerSendTextMessage(params.cid, MESSAGE_EVENT_ADVANCE, "You have finished your training.")
        end
    end
    return setPlayerExerciseTrain(params.cid, nil)
end

function onUse(cid, item, fromPos, target, toPos, isHotkey)
    local ammo = getPlayerSlotItem(cid, slotForUse)
    if ammo.uid ~= item.uid then
        return doPlayerSendCancel(cid, "The weapon must be located in your slot ammunition.")
    end
    if not target then
        return doPlayerSendDefaultCancel(cid, RETURNVALUE_NOTPOSSIBLE)
    end
    local playerPosition = getCreaturePosition(cid)
    if not getTileInfo(playerPosition).protection then
        return doPlayerSendCancel(cid, "You can only train in protection zone.")
    end
    local dummy = dummies[target.itemid]
    local weapon = weapons[item.itemid]
    if not weapon or not dummy then
        return doPlayerSendDefaultCancel(cid, RETURNVALUE_CANNOTUSETHISOBJECT)
    end
    local dummyPosition = getThingPosition(target.uid)
    if getDistanceBetween(playerPosition, dummyPosition) > 6 then
        return doPlayerSendDefaultCancel(cid, RETURNVALUE_THEREISNOWAY)
    end
    if not getPlayerExerciseTrain(cid) then
        local params = {}
        params.cid = cid
        params.currentPos = playerPosition
        params.dummyPos = toPos
        params.itemid = item.itemid
        params.dummy = dummy
        params.dummyId = target.itemid
        exerciseDummyTrainEvent(params, weapon)
        doPlayerSendTextMessage(cid, MESSAGE_EVENT_ADVANCE, "You have started training with dummy.")
    else
        doPlayerSendCancel(cid, "You can not train")
    end
    return true
end

old script
Code:
---@ Create by Sarah Wesker | Tested Version: TFS 0.4
---@ list of training dummies.
local dummies = {
    [1443] = { skillRate = 0.5, skillSpeed = 0.1 },
    [5787] = { skillRate = 0.5, skillSpeed = 0.1 }
}

---@ Global training parameters of the system.
local staminaTries = 1 --# on minutes
local skillTries = 1 --# tries by blow
local skillSpent = function() return math.random(425, 575) end --# mana consumed by blow
local slotForUse = CONST_SLOT_AMMO

---@ list of weapons to train.
local weapons = {
    [7864] = { shootEffect = CONST_ME_HITAREA, shootDistEffect = CONST_ANI_SMALLEARTH, skillType = SKILL_MAGLEVEL }, -- magicLevel Dru
    [7879] = { shootEffect = CONST_ME_HITAREA, shootDistEffect = CONST_ANI_ENERGY, skillType = SKILL_MAGLEVEL }, -- magicLevel Sor
    [2426] = { shootEffect = CONST_ME_HITAREA, shootDistEffect = CONST_ANI_SPEAR, skillType = SKILL_DISTANCE }, -- distance
    [7744] = { shootEffect = CONST_ME_HITAREA, skillType = SKILL_SWORD }, -- sword
    [7750] = { shootEffect = CONST_ME_HITAREA, skillType = SKILL_AXE }, -- axe
    [7758] = { shootEffect = CONST_ME_HITAREA, skillType = SKILL_CLUB } -- club
}

---@ EDTE is the global event table to control the system correctly.
if not EDTE then EDTE = {} end

---@ functions to assign or obtain the training status of a player.
function getPlayerExerciseTrain(cid) return EDTE[cid] or false end
function setPlayerExerciseTrain(cid, status) EDTE[cid] = status return status end

---@ local training function.
local function exerciseDummyTrainEvent(params, weapon)
    if isPlayer(params.cid) then
        local item = getPlayerSlotItem(params.cid, slotForUse)
        local playerPosition = getCreaturePosition(params.cid)
        if getDistanceBetween(playerPosition, params.currentPos) == 0 and item.itemid == params.itemid then
            local weaponCharges = getItemAttribute(item.uid, "charges") or getItemInfo(params.itemid).charges
            local reloadMs = getVocationInfo(getPlayerVocation(params.cid)).attackSpeed * params.dummy.skillSpeed
            if weaponCharges >= 1 then
                doItemSetAttribute(item.uid, "charges", weaponCharges -1)
                if weapon.shootDistEffect then doSendDistanceShoot(playerPosition, params.dummyPos, weapon.shootDistEffect) end
                if weapon.shootEffect then doSendMagicEffect(params.dummyPos, weapon.shootEffect) end
                if weapon.skillType == SKILL_MAGLEVEL then
                    doPlayerAddSpentMana(params.cid, (skillSpent() * params.dummy.skillRate) * getConfigValue("rateMagic"))
                else
                    doPlayerAddSkillTry(params.cid, weapon.skillType, (skillTries * params.dummy.skillRate) * getConfigValue("rateSkill"))
                end
                local currentStamina = getPlayerStamina(params.cid)
                doPlayerSetStamina(params.cid, currentStamina + staminaTries)
                if weaponCharges <= 1 then
                    exerciseDummyTrainEvent(params, weapon)
                else
                    setPlayerExerciseTrain(params.cid, addEvent(exerciseDummyTrainEvent, reloadMs, params, weapon))
                end
                return true
            else
                doRemoveItem(item.uid)
                doPlayerSendTextMessage(params.cid, MESSAGE_EVENT_ADVANCE, "Your exercise weapon has expired, therefore your training too.")
            end
        else
            doPlayerSendTextMessage(params.cid, MESSAGE_EVENT_ADVANCE, "You have finished your training.")
        end
    end
    return setPlayerExerciseTrain(params.cid, nil)
end

function onUse(cid, item, fromPos, target, toPos, isHotkey)
    local ammo = getPlayerSlotItem(cid, slotForUse)
    if ammo.uid ~= item.uid then
        return doPlayerSendCancel(cid, "The weapon must be located in your slot ammunition.")
    end
    if not target then
        return doPlayerSendDefaultCancel(cid, RETURNVALUE_NOTPOSSIBLE)
    end
    local playerPosition = getCreaturePosition(cid)
    if not getTileInfo(playerPosition).protection then
        return doPlayerSendCancel(cid, "You can only train in protection zone.")
    end
    local dummy = dummies[target.itemid]
    local weapon = weapons[item.itemid]
    if not weapon or not dummy then
        return doPlayerSendDefaultCancel(cid, RETURNVALUE_CANNOTUSETHISOBJECT)
    end
    local dummyPosition = getThingPosition(target.uid)
    if getDistanceBetween(playerPosition, dummyPosition) > 6 then
        return doPlayerSendDefaultCancel(cid, RETURNVALUE_THEREISNOWAY)
    end
    if not getPlayerExerciseTrain(cid) then
        local params = {}
        params.cid = cid
        params.currentPos = playerPosition
        params.dummyPos = dummyPosition
        params.itemid = item.itemid
        params.dummy = dummy
        exerciseDummyTrainEvent(params, weapon)
        doPlayerSendTextMessage(cid, MESSAGE_EVENT_ADVANCE, "You have started training with dummy.")
    else
        doPlayerSendCancel(cid, "You can not train")
    end
    return true
end
 
could someone help me with this script?
it is giving this error
I made a small change because when I trained inside the house and the dummy moved, the training continued, even without the dummy it's more there.


Lua:
---@ Create by Sarah Wesker | Tested Version: TFS 0.4
---@ list of training dummies.
local dummies = {
    [1443] = { skillRate = 0.5, skillSpeed = 0.1 },
    [5787] = { skillRate = 0.5, skillSpeed = 0.1 }
}

---@ Global training parameters of the system.
local staminaTries = 1 --# on minutes
local skillTries = 1 --# tries by blow
local skillSpent = function() return math.random(425, 575) end --# mana consumed by blow
local slotForUse = CONST_SLOT_AMMO

---@ list of weapons to train.
local weapons = {
    [7864] = { shootEffect = CONST_ME_HITAREA, shootDistEffect = CONST_ANI_SMALLEARTH, skillType = SKILL_MAGLEVEL }, -- magicLevel Dru
    [7879] = { shootEffect = CONST_ME_HITAREA, shootDistEffect = CONST_ANI_ENERGY, skillType = SKILL_MAGLEVEL }, -- magicLevel Sor
    [2426] = { shootEffect = CONST_ME_HITAREA, shootDistEffect = CONST_ANI_SPEAR, skillType = SKILL_DISTANCE }, -- distance
    [7744] = { shootEffect = CONST_ME_HITAREA, skillType = SKILL_SWORD }, -- sword
    [7750] = { shootEffect = CONST_ME_HITAREA, skillType = SKILL_AXE }, -- axe
    [7758] = { shootEffect = CONST_ME_HITAREA, skillType = SKILL_CLUB } -- club
}

---@ EDTE is the global event table to control the system correctly.
if not EDTE then EDTE = {} end

---@ functions to assign or obtain the training status of a player.
function getPlayerExerciseTrain(cid) return EDTE[cid] or false end
function setPlayerExerciseTrain(cid, status) EDTE[cid] = status return status end

---@ local training function.
local function exerciseDummyTrainEvent(params, weapon)
    if isPlayer(params.cid) then
        local foundDummy = getThingFromPosition(params.dummyPos)
        if foundDummy.itemid ~= params.dummyId then
            doPlayerSendTextMessage(params.cid, MESSAGE_EVENT_ADVANCE, "The training dummy moved.")
            return setPlayerExerciseTrain(params.cid, nil)
        end
        local item = getPlayerSlotItem(params.cid, slotForUse)
        local playerPosition = getCreaturePosition(params.cid)
        if getDistanceBetween(playerPosition, params.currentPos) == 0 and item.itemid == params.itemid then
            local weaponCharges = getItemAttribute(item.uid, "charges") or getItemInfo(params.itemid).charges
            local reloadMs = getVocationInfo(getPlayerVocation(params.cid)).attackSpeed * params.dummy.skillSpeed
            if weaponCharges >= 1 then
                doItemSetAttribute(item.uid, "charges", weaponCharges -1)
                if weapon.shootDistEffect then doSendDistanceShoot(playerPosition, params.dummyPos, weapon.shootDistEffect) end
                if weapon.shootEffect then doSendMagicEffect(params.dummyPos, weapon.shootEffect) end
                if weapon.skillType == SKILL_MAGLEVEL then
                    doPlayerAddSpentMana(params.cid, (skillSpent() * params.dummy.skillRate) * getConfigValue("rateMagic"))
                else
                    doPlayerAddSkillTry(params.cid, weapon.skillType, (skillTries * params.dummy.skillRate) * getConfigValue("rateSkill"))
                end
                local currentStamina = getPlayerStamina(params.cid)
                doPlayerSetStamina(params.cid, currentStamina + staminaTries)
                if weaponCharges <= 1 then
                    exerciseDummyTrainEvent(params, weapon)
                else
                    setPlayerExerciseTrain(params.cid, addEvent(exerciseDummyTrainEvent, reloadMs, params, weapon))
                end
                return true
            else
                doRemoveItem(item.uid)
                doPlayerSendTextMessage(params.cid, MESSAGE_EVENT_ADVANCE, "Your exercise weapon has expired, therefore your training too.")
            end
        else
            doPlayerSendTextMessage(params.cid, MESSAGE_EVENT_ADVANCE, "You have finished your training.")
        end
    end
    return setPlayerExerciseTrain(params.cid, nil)
end

function onUse(cid, item, fromPos, target, toPos, isHotkey)
    local ammo = getPlayerSlotItem(cid, slotForUse)
    if ammo.uid ~= item.uid then
        return doPlayerSendCancel(cid, "The weapon must be located in your slot ammunition.")
    end
    if not target then
        return doPlayerSendDefaultCancel(cid, RETURNVALUE_NOTPOSSIBLE)
    end
    local playerPosition = getCreaturePosition(cid)
    if not getTileInfo(playerPosition).protection then
        return doPlayerSendCancel(cid, "You can only train in protection zone.")
    end
    local dummy = dummies[target.itemid]
    local weapon = weapons[item.itemid]
    if not weapon or not dummy then
        return doPlayerSendDefaultCancel(cid, RETURNVALUE_CANNOTUSETHISOBJECT)
    end
    local dummyPosition = getThingPosition(target.uid)
    if getDistanceBetween(playerPosition, dummyPosition) > 6 then
        return doPlayerSendDefaultCancel(cid, RETURNVALUE_THEREISNOWAY)
    end
    if not getPlayerExerciseTrain(cid) then
        local params = {}
        params.cid = cid
        params.currentPos = playerPosition
        params.dummyPos = toPos
        params.itemid = item.itemid
        params.dummy = dummy
        params.dummyId = target.itemid
        exerciseDummyTrainEvent(params, weapon)
        doPlayerSendTextMessage(cid, MESSAGE_EVENT_ADVANCE, "You have started training with dummy.")
    else
        doPlayerSendCancel(cid, "You can not train")
    end
    return true
end

old script
Code:
---@ Create by Sarah Wesker | Tested Version: TFS 0.4
---@ list of training dummies.
local dummies = {
    [1443] = { skillRate = 0.5, skillSpeed = 0.1 },
    [5787] = { skillRate = 0.5, skillSpeed = 0.1 }
}

---@ Global training parameters of the system.
local staminaTries = 1 --# on minutes
local skillTries = 1 --# tries by blow
local skillSpent = function() return math.random(425, 575) end --# mana consumed by blow
local slotForUse = CONST_SLOT_AMMO

---@ list of weapons to train.
local weapons = {
    [7864] = { shootEffect = CONST_ME_HITAREA, shootDistEffect = CONST_ANI_SMALLEARTH, skillType = SKILL_MAGLEVEL }, -- magicLevel Dru
    [7879] = { shootEffect = CONST_ME_HITAREA, shootDistEffect = CONST_ANI_ENERGY, skillType = SKILL_MAGLEVEL }, -- magicLevel Sor
    [2426] = { shootEffect = CONST_ME_HITAREA, shootDistEffect = CONST_ANI_SPEAR, skillType = SKILL_DISTANCE }, -- distance
    [7744] = { shootEffect = CONST_ME_HITAREA, skillType = SKILL_SWORD }, -- sword
    [7750] = { shootEffect = CONST_ME_HITAREA, skillType = SKILL_AXE }, -- axe
    [7758] = { shootEffect = CONST_ME_HITAREA, skillType = SKILL_CLUB } -- club
}

---@ EDTE is the global event table to control the system correctly.
if not EDTE then EDTE = {} end

---@ functions to assign or obtain the training status of a player.
function getPlayerExerciseTrain(cid) return EDTE[cid] or false end
function setPlayerExerciseTrain(cid, status) EDTE[cid] = status return status end

---@ local training function.
local function exerciseDummyTrainEvent(params, weapon)
    if isPlayer(params.cid) then
        local item = getPlayerSlotItem(params.cid, slotForUse)
        local playerPosition = getCreaturePosition(params.cid)
        if getDistanceBetween(playerPosition, params.currentPos) == 0 and item.itemid == params.itemid then
            local weaponCharges = getItemAttribute(item.uid, "charges") or getItemInfo(params.itemid).charges
            local reloadMs = getVocationInfo(getPlayerVocation(params.cid)).attackSpeed * params.dummy.skillSpeed
            if weaponCharges >= 1 then
                doItemSetAttribute(item.uid, "charges", weaponCharges -1)
                if weapon.shootDistEffect then doSendDistanceShoot(playerPosition, params.dummyPos, weapon.shootDistEffect) end
                if weapon.shootEffect then doSendMagicEffect(params.dummyPos, weapon.shootEffect) end
                if weapon.skillType == SKILL_MAGLEVEL then
                    doPlayerAddSpentMana(params.cid, (skillSpent() * params.dummy.skillRate) * getConfigValue("rateMagic"))
                else
                    doPlayerAddSkillTry(params.cid, weapon.skillType, (skillTries * params.dummy.skillRate) * getConfigValue("rateSkill"))
                end
                local currentStamina = getPlayerStamina(params.cid)
                doPlayerSetStamina(params.cid, currentStamina + staminaTries)
                if weaponCharges <= 1 then
                    exerciseDummyTrainEvent(params, weapon)
                else
                    setPlayerExerciseTrain(params.cid, addEvent(exerciseDummyTrainEvent, reloadMs, params, weapon))
                end
                return true
            else
                doRemoveItem(item.uid)
                doPlayerSendTextMessage(params.cid, MESSAGE_EVENT_ADVANCE, "Your exercise weapon has expired, therefore your training too.")
            end
        else
            doPlayerSendTextMessage(params.cid, MESSAGE_EVENT_ADVANCE, "You have finished your training.")
        end
    end
    return setPlayerExerciseTrain(params.cid, nil)
end

function onUse(cid, item, fromPos, target, toPos, isHotkey)
    local ammo = getPlayerSlotItem(cid, slotForUse)
    if ammo.uid ~= item.uid then
        return doPlayerSendCancel(cid, "The weapon must be located in your slot ammunition.")
    end
    if not target then
        return doPlayerSendDefaultCancel(cid, RETURNVALUE_NOTPOSSIBLE)
    end
    local playerPosition = getCreaturePosition(cid)
    if not getTileInfo(playerPosition).protection then
        return doPlayerSendCancel(cid, "You can only train in protection zone.")
    end
    local dummy = dummies[target.itemid]
    local weapon = weapons[item.itemid]
    if not weapon or not dummy then
        return doPlayerSendDefaultCancel(cid, RETURNVALUE_CANNOTUSETHISOBJECT)
    end
    local dummyPosition = getThingPosition(target.uid)
    if getDistanceBetween(playerPosition, dummyPosition) > 6 then
        return doPlayerSendDefaultCancel(cid, RETURNVALUE_THEREISNOWAY)
    end
    if not getPlayerExerciseTrain(cid) then
        local params = {}
        params.cid = cid
        params.currentPos = playerPosition
        params.dummyPos = dummyPosition
        params.itemid = item.itemid
        params.dummy = dummy
        exerciseDummyTrainEvent(params, weapon)
        doPlayerSendTextMessage(cid, MESSAGE_EVENT_ADVANCE, "You have started training with dummy.")
    else
        doPlayerSendCancel(cid, "You can not train")
    end
    return true
end
I cant locate, where is ur change?
 
Just don't move the dummy, fixed.
kkkkk
Post automatically merged:

I cant locate, where is ur change?

I got the solution here, but I think I didn't edit the script correctly and this bug came
post #38 by Sarah Wesker
 
Last edited:
kkkkk
Post automatically merged:



I got the solution here, but I think I didn't edit the script correctly and this bug came
post #38 by Sarah Wesker
try to use like this:

Lua:
---@ local training function.
local function exerciseDummyTrainEvent(params, weapon)
    if isPlayer(params.cid) then
    local foundDummy = getThingFromPosition(params.dummyPos)
        if foundDummy.itemid ~= params.dummyId then
    doPlayerSendTextMessage(params.cid, MESSAGE_EVENT_ADVANCE, "The training dummy moved.")
    return setPlayerExerciseTrain(params.cid, nil)
end

and

Lua:
if not getPlayerExerciseTrain(cid) then
        local params = {}
        params.cid = cid
        params.currentPos = playerPosition
        params.dummyPos = toPos
        params.itemid = item.itemid
        params.dummy = dummy
        params.dummyId = target.itemid
        exerciseDummyTrainEvent(params, weapon)
        doPlayerSendTextMessage(cid, MESSAGE_EVENT_ADVANCE, "You have started training with dummy.")
    else
        doPlayerSendCancel(cid, "You can not train")
    end
    return true
end
 
tente usar assim:

[CÓDIGO=LUA]
---@ função de treinamento local.
função local exercicioDummyTrainEvent(params, arma)
se isPlayer(params.cid) então
local foundDummy = getThingFromPosition(params.dummyPos)
se encontradoDummy.itemid ~= params.dummyId então
doPlayerSendTextMessage(params.cid, MESSAGE_EVENT_ADVANCE, "O manequim de treinamento se moveu.")
return setPlayerExerciseTrain(params.cid, nil)
fim
[/CÓDIGO]

e

[CÓDIGO=LUA]
se não getPlayerExerciseTrain(cid) então
parâmetros locais = {}
params.cid = cid
params.currentPos = playerPosition
params.dummyPos = toPos
params.itemid = item.itemid
params.dummy = dummy
params.dummyId = target.itemid
exercicioDummyTrainEvent(parâmetros, arma)
doPlayerSendTextMessage(cid, MESSAGE_EVENT_ADVANCE, "Você começou a treinar com manequim.")
senão
doPlayerSendCancel(cid, "Você não pode treinar")
fim
retornar verdadeiro
fim
[/CÓDIGO]
[Error - Action Interface]
data/actions/scripts/drummy.lua:eek:nUse
Description:
data/actions/scripts/drummy.lua:72: attempt to call global 'getThingFromPosition' (a nil value)
stack traceback:
data/actions/scripts/drummy.lua:72: in function 'exerciseDummyTrainEvent'
data/actions/scripts/drummy.lua:108: in function <data/actions/scripts/drummy.lua:79>
Code:
---@ Create by Sarah Wesker | Tested Version: TFS 0.4
---@ list of training dummies.
local dummies = {
    [1476] = { skillRate = 0.7, skillSpeed = 3 },
    [1477] = { skillRate = 0.7, skillSpeed = 3 },
    [1478] = { skillRate = 0.7, skillSpeed = 3 },
    [1442] = { skillRate = 0.7, skillSpeed = 3 },
    [5787] = { skillRate = 0.5, skillSpeed = 3 }
}

---@ Global training parameters of the system.
local staminaTries = 1 --# on minutes
local skillTries = 1 --# tries by blow
local skillSpent = function() return math.random(425, 575) end --# mana consumed by blow
local slotForUse = CONST_SLOT_AMMO

---@ list of weapons to train.
local weapons = {
    [7864] = { shootEffect = CONST_ME_POISONAREA, shootDistEffect = CONST_ANI_SMALLEARTH, skillType = SKILL_MAGLEVEL }, -- magicLevel Dru
    [7879] = { shootEffect = CONST_ME_ENERGYHIT, shootDistEffect = CONST_ANI_ENERGY, skillType = SKILL_MAGLEVEL }, -- magicLevel Sor
    [2426] = { shootEffect = CONST_ME_DRAWBLOOD, shootDistEffect = CONST_ANI_SPEAR, skillType = SKILL_DISTANCE }, -- distance
    [7744] = { shootEffect = CONST_ME_GROUNDSHAKER, skillType = SKILL_SWORD }, -- sword
    [7750] = { shootEffect = CONST_ME_GROUNDSHAKER, skillType = SKILL_AXE }, -- axe
    [7758] = { shootEffect = CONST_ME_GROUNDSHAKER, skillType = SKILL_CLUB } -- club
}

---@ EDTE is the global event table to control the system correctly.
if not EDTE then EDTE = {} end

---@ functions to assign or obtain the training status of a player.
function getPlayerExerciseTrain(cid) return EDTE[cid] or false end
function setPlayerExerciseTrain(cid, status) EDTE[cid] = status return status end

---@ local training function
local function exerciseDummyTrainEvent(params, weapon)
    if isPlayer(params.cid) then
        local item = getPlayerSlotItem(params.cid, slotForUse)
        local playerPosition = getCreaturePosition(params.cid)
        if getDistanceBetween(playerPosition, params.currentPos) == 0 and item.itemid == params.itemid then
            local weaponCharges = getItemAttribute(item.uid, "charges") or getItemInfo(params.itemid).charges
            local reloadMs = getVocationInfo(getPlayerVocation(params.cid)).attackSpeed * params.dummy.skillSpeed
            if weaponCharges >= 1 then
                doItemSetAttribute(item.uid, "charges", weaponCharges -1)
                if weapon.shootDistEffect then doSendDistanceShoot(playerPosition, params.dummyPos, weapon.shootDistEffect) end
                if weapon.shootEffect then doSendMagicEffect(params.dummyPos, weapon.shootEffect) end
                if weapon.skillType == SKILL_MAGLEVEL then
                    doPlayerAddSpentMana(params.cid, (skillSpent() * params.dummy.skillRate) * getConfigValue("rateMagic"))
                else
                    doPlayerAddSkillTry(params.cid, weapon.skillType, (skillTries * params.dummy.skillRate) * getConfigValue("rateSkill"))
                end
                local currentStamina = getPlayerStamina(params.cid)
                doPlayerSetStamina(params.cid, currentStamina + staminaTries)
                if weaponCharges <= 1 then
                    exerciseDummyTrainEvent(params, weapon)
                else
                    setPlayerExerciseTrain(params.cid, addEvent(exerciseDummyTrainEvent, reloadMs, params, weapon))
                end
                return true
            else
                doRemoveItem(item.uid)
                doPlayerSendTextMessage(params.cid, MESSAGE_EVENT_ADVANCE, "Your exercise weapon has expired, therefore your training too.")
            end
        else
            doPlayerSendTextMessage(params.cid, MESSAGE_EVENT_ADVANCE, "You have finished your training.")
        end
    end
    return setPlayerExerciseTrain(params.cid, nil)
end
---@ local training function.
local function exerciseDummyTrainEvent(params, weapon)
    if isPlayer(params.cid) then
    local foundDummy = getThingFromPosition(params.dummyPos)
        if foundDummy.itemid ~= params.dummyId then
    doPlayerSendTextMessage(params.cid, MESSAGE_EVENT_ADVANCE, "The training dummy moved.")
    return setPlayerExerciseTrain(params.cid, nil)
    end
end
end
function onUse(cid, item, fromPos, target, toPos, isHotkey)
    local ammo = getPlayerSlotItem(cid, slotForUse)
    if ammo.uid ~= item.uid then
        return doPlayerSendCancel(cid, "The weapon must be located in your slot ammunition.")
    end
    if not target then
        return doPlayerSendDefaultCancel(cid, RETURNVALUE_NOTPOSSIBLE)
    end
    local playerPosition = getCreaturePosition(cid)
    if not getTileInfo(playerPosition).protection then
        return doPlayerSendCancel(cid, "You can only train in protection zone.")
    end
    local dummy = dummies[target.itemid]
    local weapon = weapons[item.itemid]
    if not weapon or not dummy then
        return doPlayerSendDefaultCancel(cid, RETURNVALUE_CANNOTUSETHISOBJECT)
    end
    local dummyPosition = getThingPosition(target.uid)
    if getDistanceBetween(playerPosition, dummyPosition) > 6 then
        return doPlayerSendDefaultCancel(cid, RETURNVALUE_THEREISNOWAY)
    end
if not getPlayerExerciseTrain(cid) then
        local params = {}
        params.cid = cid
        params.currentPos = playerPosition
        params.dummyPos = toPos
        params.itemid = item.itemid
        params.dummy = dummy
        params.dummyId = target.itemid
        exerciseDummyTrainEvent(params, weapon)
        doPlayerSendTextMessage(cid, MESSAGE_EVENT_ADVANCE, "You have started training with dummy.")
    else
        doPlayerSendCancel(cid, "You can not train")
    end
    return true
end
 
Last edited:
Lua:
---@ Create by Sarah Wesker | Tested Version: TFS 0.4
---@ list of training dummies.
local dummies = {
    [1476] = { skillRate = 0.7, skillSpeed = 3 },
    [1477] = { skillRate = 0.7, skillSpeed = 3 },
    [1478] = { skillRate = 0.7, skillSpeed = 3 },
    [1442] = { skillRate = 0.7, skillSpeed = 3 },
    [5787] = { skillRate = 0.5, skillSpeed = 3 }
}

---@ Global training parameters of the system.
local staminaTries = 1 --# on minutes
local skillTries = 1 --# tries by blow
local skillSpent = function() return math.random(425, 575) end --# mana consumed by blow
local slotForUse = CONST_SLOT_AMMO

---@ list of weapons to train.
local weapons = {
    [7864] = { shootEffect = CONST_ME_POISONAREA, shootDistEffect = CONST_ANI_SMALLEARTH, skillType = SKILL_MAGLEVEL }, -- magicLevel Dru
    [7879] = { shootEffect = CONST_ME_ENERGYHIT, shootDistEffect = CONST_ANI_ENERGY, skillType = SKILL_MAGLEVEL }, -- magicLevel Sor
    [2426] = { shootEffect = CONST_ME_DRAWBLOOD, shootDistEffect = CONST_ANI_SPEAR, skillType = SKILL_DISTANCE }, -- distance
    [7744] = { shootEffect = CONST_ME_GROUNDSHAKER, skillType = SKILL_SWORD }, -- sword
    [7750] = { shootEffect = CONST_ME_GROUNDSHAKER, skillType = SKILL_AXE }, -- axe
    [7758] = { shootEffect = CONST_ME_GROUNDSHAKER, skillType = SKILL_CLUB } -- club
}

---@ EDTE is the global event table to control the system correctly.
if not EDTE then EDTE = {} end

---@ functions to assign or obtain the training status of a player.
function getPlayerExerciseTrain(cid) return EDTE[cid] or false end
function setPlayerExerciseTrain(cid, status) EDTE[cid] = status return status end

---@ local training function.
local function exerciseDummyTrainEvent(params, weapon)
    if isPlayer(params.cid) then
    local foundDummy = getThingFromPosition(params.dummyPos)
        if foundDummy.itemid ~= params.dummyId then
    doPlayerSendTextMessage(params.cid, MESSAGE_EVENT_ADVANCE, "The training dummy moved.")
    return setPlayerExerciseTrain(params.cid, nil)
        end
end
local function exerciseDummyTrainEvent(params, weapon)
    if isPlayer(params.cid) then
        local item = getPlayerSlotItem(params.cid, slotForUse)
        local playerPosition = getCreaturePosition(params.cid)
        if getDistanceBetween(playerPosition, params.currentPos) == 0 and item.itemid == params.itemid then
            local weaponCharges = getItemAttribute(item.uid, "charges") or getItemInfo(params.itemid).charges
            local reloadMs = getVocationInfo(getPlayerVocation(params.cid)).attackSpeed * params.dummy.skillSpeed
            if weaponCharges >= 1 then
                doItemSetAttribute(item.uid, "charges", weaponCharges -1)
                if weapon.shootDistEffect then doSendDistanceShoot(playerPosition, params.dummyPos, weapon.shootDistEffect) end
                if weapon.shootEffect then doSendMagicEffect(params.dummyPos, weapon.shootEffect) end
                if weapon.skillType == SKILL_MAGLEVEL then
                    doPlayerAddSpentMana(params.cid, (skillSpent() * params.dummy.skillRate) * getConfigValue("rateMagic"))
                else
                    doPlayerAddSkillTry(params.cid, weapon.skillType, (skillTries * params.dummy.skillRate) * getConfigValue("rateSkill"))
                end
                local currentStamina = getPlayerStamina(params.cid)
                doPlayerSetStamina(params.cid, currentStamina + staminaTries)
                if weaponCharges <= 1 then
                    exerciseDummyTrainEvent(params, weapon)
                else
                    setPlayerExerciseTrain(params.cid, addEvent(exerciseDummyTrainEvent, reloadMs, params, weapon))
                end
                return true
            else
                doRemoveItem(item.uid)
                doPlayerSendTextMessage(params.cid, MESSAGE_EVENT_ADVANCE, "Your exercise weapon has expired, therefore your training too.")
            end
        else
            doPlayerSendTextMessage(params.cid, MESSAGE_EVENT_ADVANCE, "You have finished your training.")
        end
    end
    return setPlayerExerciseTrain(params.cid, nil)
end

function onUse(cid, item, fromPos, target, toPos, isHotkey)
    local ammo = getPlayerSlotItem(cid, slotForUse)
    if ammo.uid ~= item.uid then
        return doPlayerSendCancel(cid, "A arma deve estar localizada em seu slot de munição.")
    fim
    se não for alvo então
        return doPlayerSendDefaultCancel(cid, RETURNVALUE_NOTPOSSIBLE)
    fim
    playerPosition local = getCreaturePosition(cid)
    se não getTileInfo(playerPosition).protection então
        return doPlayerSendCancel(cid, "Você só pode treinar na zona de proteção.")
    fim
    manequim local = manequins[target.itemid]
    arma local = armas[item.itemid]
    se não for arma ou não manequim então
        return doPlayerSendDefaultCancel(cid, RETURNVALUE_CANNOTUSETHISOBJECT)
    fim
    local dummyPosition = getThingPosition(target.uid)
    se getDistanceBetween(playerPosition, dummyPosition) > 6 então
        return doPlayerSendDefaultCancel(cid, RETURNVALUE_THEREISNOWAY)
    fim
se não getPlayerExerciseTrain(cid) então
        parâmetros locais = {}
        params.cid = cid
        params.currentPos = playerPosition
        params.dummyPos = toPos
        params.itemid = item.itemid
        params.dummy = dummy
        params.dummyId = target.itemid
        exercicioDummyTrainEvent(parâmetros, arma)
        doPlayerSendTextMessage(cid, MESSAGE_EVENT_ADVANCE, "Você começou a treinar com manequim.")
    senão
        doPlayerSendCancel(cid, "Você não pode treinar")
    fim
    retornar verdadeiro
fim
Please, adjust your translator. But remove at line 41 or 42 one "end".
 
try to use this one, remember to change id of dummies, weapons and slot to use:

Lua:
---@ Create by Sarah Wesker | Tested Version: TFS 0.4
---@ list of training dummies.
local dummies = {
    [5901] = { skillRate = 1.1, skillSpeed = 0.5 },
    [5902] = { skillRate = 1.1, skillSpeed = 0.5 },
    [5749] = { skillRate = 1.1, skillSpeed = 0.5 },
    [5750] = { skillRate = 1.1, skillSpeed = 0.5 },
    [5748] = { skillRate = 1.0, skillSpeed = 0.5 },
    [5751] = { skillRate = 1.0, skillSpeed = 0.5 }
}

---@ Global training parameters of the system.
local skillTries = 2 --# tries by blow
local skillSpent = function() return math.random(150, 300) end --# mana consumed by blow
local slotForUse = CONST_SLOT_LEFT

---@ list of weapons to train.
local weapons = {
    [5756] = { shootEffect = CONST_ME_HITAREA, shootDistEffect = CONST_ANI_POISON, skillType = SKILL_MAGLEVEL }, -- magicLevel Dru
    [5757] = { shootEffect = CONST_ME_HITAREA, shootDistEffect = CONST_ANI_ENERGY, skillType = SKILL_MAGLEVEL }, -- magicLevel Sor
    [5761] = { shootEffect = CONST_ME_HITAREA, shootDistEffect = CONST_ANI_ARROW, skillType = SKILL_DISTANCE }, -- distance
    [5758] = { shootEffect = CONST_ME_HITAREA, skillType = SKILL_SWORD }, -- sword
    [5759] = { shootEffect = CONST_ME_HITAREA, skillType = SKILL_AXE }, -- axe
    [5760] = { shootEffect = CONST_ME_HITAREA, skillType = SKILL_CLUB } -- club
}

---@ EDTE is the global event table to control the system correctly.
if not EDTE then EDTE = {} end

---@ functions to assign or obtain the training status of a player.
function getPlayerExerciseTrain(cid) return EDTE[cid] or false end
function setPlayerExerciseTrain(cid, status) EDTE[cid] = status return status end

---@ local training function.
local function exerciseDummyTrainEvent(params, weapon)
    if isPlayer(params.cid) then
    local foundDummy = getThingFromPosition(params.dummyPos)
        if foundDummy.itemid ~= params.dummyId then
    doPlayerSendTextMessage(params.cid, MESSAGE_EVENT_ADVANCE, "The training dummy moved.")
    return setPlayerExerciseTrain(params.cid, nil)
end
        local item = getPlayerSlotItem(params.cid, slotForUse)
        local playerPosition = getCreaturePosition(params.cid)
        if getDistanceBetween(playerPosition, params.currentPos) == 0 and item.itemid == params.itemid then
            local weaponCharges = getItemAttribute(item.uid, "charges") or getItemInfo(params.itemid).charges
            local reloadMs = getVocationInfo(getPlayerVocation(params.cid)).attackSpeed * params.dummy.skillSpeed
            if weaponCharges >= 1 then
                doItemSetAttribute(item.uid, "charges", weaponCharges -1)
                if weapon.shootDistEffect then doSendDistanceShoot(playerPosition, params.dummyPos, weapon.shootDistEffect) end
                if weapon.shootEffect then doSendMagicEffect(params.dummyPos, weapon.shootEffect) end
                if weapon.skillType == SKILL_MAGLEVEL then
                    doPlayerAddSpentMana(params.cid, (skillSpent() * params.dummy.skillRate) * getConfigValue("rateMagic"))
                else
                    doPlayerAddSkillTry(params.cid, weapon.skillType, (skillTries * params.dummy.skillRate) * getConfigValue("rateSkill"))
                end
                if weaponCharges <= 1 then
                    exerciseDummyTrainEvent(params, weapon)
                else
                    setPlayerExerciseTrain(params.cid, addEvent(exerciseDummyTrainEvent, reloadMs, params, weapon))
                end
                return true
            else
                doRemoveItem(item.uid)
                doPlayerSendTextMessage(params.cid, MESSAGE_EVENT_ADVANCE, "Your exercise weapon has expired, therefore your training too.")
            end
        else
            doPlayerSendTextMessage(params.cid, MESSAGE_EVENT_ADVANCE, "You have finished your training.")
        end
    end
    return setPlayerExerciseTrain(params.cid, nil)
end

function onUse(cid, item, fromPos, target, toPos, isHotkey)
    local ammo = getPlayerSlotItem(cid, slotForUse)
    if ammo.uid ~= item.uid then
        return doPlayerSendCancel(cid, "The weapon must be located in your left hand.")
    end
    if not target then
        return doPlayerSendDefaultCancel(cid, RETURNVALUE_NOTPOSSIBLE)
    end
    local playerPosition = getCreaturePosition(cid)
    if not getTileInfo(playerPosition).protection then
        return doPlayerSendCancel(cid, "You can only train in protection zone.")
    end
    local dummy = dummies[target.itemid]
    local weapon = weapons[item.itemid]
    if not weapon or not dummy then
        return doPlayerSendDefaultCancel(cid, RETURNVALUE_CANNOTUSETHISOBJECT)
    end
    local dummyPosition = getThingPosition(target.uid)
    if getDistanceBetween(playerPosition, dummyPosition) > 6 then
        return doPlayerSendDefaultCancel(cid, RETURNVALUE_THEREISNOWAY)
    end
    if not getPlayerExerciseTrain(cid) then
        local params = {}
        params.cid = cid
        params.currentPos = playerPosition
        params.dummyPos = toPos
        params.itemid = item.itemid
        params.dummy = dummy
        params.dummyId = target.itemid
        exerciseDummyTrainEvent(params, weapon)
        doPlayerSendTextMessage(cid, MESSAGE_EVENT_ADVANCE, "You have started training with dummy.")
    else
        doPlayerSendCancel(cid, "You can not train")
    end
    return true
end
 
try to use this one, remember to change id of dummies, weapons and slot to use:

Lua:
---@ Create by Sarah Wesker | Tested Version: TFS 0.4
---@ list of training dummies.
local dummies = {
    [5901] = { skillRate = 1.1, skillSpeed = 0.5 },
    [5902] = { skillRate = 1.1, skillSpeed = 0.5 },
    [5749] = { skillRate = 1.1, skillSpeed = 0.5 },
    [5750] = { skillRate = 1.1, skillSpeed = 0.5 },
    [5748] = { skillRate = 1.0, skillSpeed = 0.5 },
    [5751] = { skillRate = 1.0, skillSpeed = 0.5 }
}

---@ Global training parameters of the system.
local skillTries = 2 --# tries by blow
local skillSpent = function() return math.random(150, 300) end --# mana consumed by blow
local slotForUse = CONST_SLOT_LEFT

---@ list of weapons to train.
local weapons = {
    [5756] = { shootEffect = CONST_ME_HITAREA, shootDistEffect = CONST_ANI_POISON, skillType = SKILL_MAGLEVEL }, -- magicLevel Dru
    [5757] = { shootEffect = CONST_ME_HITAREA, shootDistEffect = CONST_ANI_ENERGY, skillType = SKILL_MAGLEVEL }, -- magicLevel Sor
    [5761] = { shootEffect = CONST_ME_HITAREA, shootDistEffect = CONST_ANI_ARROW, skillType = SKILL_DISTANCE }, -- distance
    [5758] = { shootEffect = CONST_ME_HITAREA, skillType = SKILL_SWORD }, -- sword
    [5759] = { shootEffect = CONST_ME_HITAREA, skillType = SKILL_AXE }, -- axe
    [5760] = { shootEffect = CONST_ME_HITAREA, skillType = SKILL_CLUB } -- club
}

---@ EDTE is the global event table to control the system correctly.
if not EDTE then EDTE = {} end

---@ functions to assign or obtain the training status of a player.
function getPlayerExerciseTrain(cid) return EDTE[cid] or false end
function setPlayerExerciseTrain(cid, status) EDTE[cid] = status return status end

---@ local training function.
local function exerciseDummyTrainEvent(params, weapon)
    if isPlayer(params.cid) then
    local foundDummy = getThingFromPosition(params.dummyPos)
        if foundDummy.itemid ~= params.dummyId then
    doPlayerSendTextMessage(params.cid, MESSAGE_EVENT_ADVANCE, "The training dummy moved.")
    return setPlayerExerciseTrain(params.cid, nil)
end
        local item = getPlayerSlotItem(params.cid, slotForUse)
        local playerPosition = getCreaturePosition(params.cid)
        if getDistanceBetween(playerPosition, params.currentPos) == 0 and item.itemid == params.itemid then
            local weaponCharges = getItemAttribute(item.uid, "charges") or getItemInfo(params.itemid).charges
            local reloadMs = getVocationInfo(getPlayerVocation(params.cid)).attackSpeed * params.dummy.skillSpeed
            if weaponCharges >= 1 then
                doItemSetAttribute(item.uid, "charges", weaponCharges -1)
                if weapon.shootDistEffect then doSendDistanceShoot(playerPosition, params.dummyPos, weapon.shootDistEffect) end
                if weapon.shootEffect then doSendMagicEffect(params.dummyPos, weapon.shootEffect) end
                if weapon.skillType == SKILL_MAGLEVEL then
                    doPlayerAddSpentMana(params.cid, (skillSpent() * params.dummy.skillRate) * getConfigValue("rateMagic"))
                else
                    doPlayerAddSkillTry(params.cid, weapon.skillType, (skillTries * params.dummy.skillRate) * getConfigValue("rateSkill"))
                end
                if weaponCharges <= 1 then
                    exerciseDummyTrainEvent(params, weapon)
                else
                    setPlayerExerciseTrain(params.cid, addEvent(exerciseDummyTrainEvent, reloadMs, params, weapon))
                end
                return true
            else
                doRemoveItem(item.uid)
                doPlayerSendTextMessage(params.cid, MESSAGE_EVENT_ADVANCE, "Your exercise weapon has expired, therefore your training too.")
            end
        else
            doPlayerSendTextMessage(params.cid, MESSAGE_EVENT_ADVANCE, "You have finished your training.")
        end
    end
    return setPlayerExerciseTrain(params.cid, nil)
end

function onUse(cid, item, fromPos, target, toPos, isHotkey)
    local ammo = getPlayerSlotItem(cid, slotForUse)
    if ammo.uid ~= item.uid then
        return doPlayerSendCancel(cid, "The weapon must be located in your left hand.")
    end
    if not target then
        return doPlayerSendDefaultCancel(cid, RETURNVALUE_NOTPOSSIBLE)
    end
    local playerPosition = getCreaturePosition(cid)
    if not getTileInfo(playerPosition).protection then
        return doPlayerSendCancel(cid, "You can only train in protection zone.")
    end
    local dummy = dummies[target.itemid]
    local weapon = weapons[item.itemid]
    if not weapon or not dummy then
        return doPlayerSendDefaultCancel(cid, RETURNVALUE_CANNOTUSETHISOBJECT)
    end
    local dummyPosition = getThingPosition(target.uid)
    if getDistanceBetween(playerPosition, dummyPosition) > 6 then
        return doPlayerSendDefaultCancel(cid, RETURNVALUE_THEREISNOWAY)
    end
    if not getPlayerExerciseTrain(cid) then
        local params = {}
        params.cid = cid
        params.currentPos = playerPosition
        params.dummyPos = toPos
        params.itemid = item.itemid
        params.dummy = dummy
        params.dummyId = target.itemid
        exerciseDummyTrainEvent(params, weapon)
        doPlayerSendTextMessage(cid, MESSAGE_EVENT_ADVANCE, "You have started training with dummy.")
    else
        doPlayerSendCancel(cid, "You can not train")
    end
    return true
end
persists
[Error - Action Interface]
data/actions/scripts/drummy.lua:eek:nUse
Description:
data/actions/scripts/drummy.lua:36: attempt to call global 'getThingFromPosition' (a nil value)
stack traceback:
data/actions/scripts/drummy.lua:36: in function 'exerciseDummyTrainEvent'
data/actions/scripts/drummy.lua:101: in function <data/actions/scripts/drummy.lua:72>
 
persists
[Error - Action Interface]
data/actions/scripts/drummy.lua:eek:nUse
Description:
data/actions/scripts/drummy.lua:36: attempt to call global 'getThingFromPosition' (a nil value)
stack traceback:
data/actions/scripts/drummy.lua:36: in function 'exerciseDummyTrainEvent'
data/actions/scripts/drummy.lua:101: in function <data/actions/scripts/drummy.lua:72>
How do you put at actions.xml?
 
Back
Top