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

Cant create new Variant

miens

Combos and Freedom
Joined
Nov 6, 2016
Messages
61
Reaction score
8
Hello,
as I was toying with spells and lua I encountered a problem. Everytime I am trying to create a new Variant, Tile or Position I get error saying that global 'Variant' is a nil value. What might be the reason for this?
 
@miens could you show the code with positionToVariant ? I am trying to do the same think but every time when i invoke combat with positionToVariant i crash server :/


Lua:
function doMultistrike(playerId, item, targetPosition)
    -- DebugPrint("Multistrike! 22")
    local itemType = ItemType(item:getId())
    if itemType:getWeaponType() == WEAPON_SWORD or itemType:getWeaponType() == WEAPON_CLUB or itemType:getWeaponType() == WEAPON_AXE then
        local creature = Tile(targetPosition):getTopCreature()
        if creature then
            whiteWeaponCombat:execute(Player(playerId), Variant(creature:getId()))
        end
        return true
    end
    return false
end

That function product stackoverflow, what i am doing wrong ?
 
Last edited:
Back
Top