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

TFS 1.X+ dota event tfs 1.2

Madusa

Active Member
Joined
Sep 8, 2022
Messages
117
Reaction score
32
Location
Egypt
Dota.lua
Lua:
function onStepIn(cid, item, pos, frompos)
local positions = {
{x=691, y=42, z=7},
{x=595, y=42, z=7}
}
local destino = math.random(#positions)
doTeleportThing(cid,positions[destino], true)
doSendMagicEffect(getPlayerPosition(cid), 10)
end
Blue.lua
Code:
local conditionBlue = Condition(CONDITION_OUTFIT)
conditionBlue:setOutfit({lookType = 128, lookHead = 88, lookBody = 114, lookLegs = 88, lookFeet = 88, lookAddons = 2})

function onStepIn(cid, item, frompos, item2, topos)
    local player = Player(cid)
    if not player then
        return true
    end
    player:addCondition(conditionBlue)
        Game.setStorageValue(140400, Game.getStorageValue(140400) + 1)
        Game.broadcastMessage(string.format('%s has joined the DotA! [%s/100].', player:getName(), Game.getStorageValue(140400)), MESSAGE_STATUS_WARNING)
end
Error]\/\/
Code:
Lua Script Error: [MoveEvents Interface]
data/movements/scripts/eventos/blue.lua:onStepIn
data/movements/scripts/eventos/blue.lua:10: attempt to perform arithmetic on a n
il value
stack traceback:
        [C]: in function '__add'
        data/movements/scripts/eventos/blue.lua:10: in function <data/movements/
scripts/eventos/blue.lua:4>
        [C]: in function 'doTeleportThing'
        data/movements/scripts/eventos/dota.lua:7: in function <data/movements/s
cripts/eventos/dota.lua:1>
We run into this problem, it changes its shape for a second, and then it goes back to its previous appearance
 
There is a specific tile on which the player is moved to select an outfit for him and a blue color or another color, depending on the team. The shape is already changed for one second, then it returns to the old appearance of the player’s shape
Is there anyone who can help
 
There is a specific tile on which the player is moved to select an outfit for him and a blue color or another color, depending on the team. The shape is already changed for one second, then it returns to the old appearance of the player’s shape
Is there anyone who can help
maybe

Lua:
conditionBlue:setParameter(CONDITION_PARAM_TICKS, -1)

Lua:
local conditionBlue = Condition(CONDITION_OUTFIT)
conditionBlue:setOutfit({lookType = 128, lookHead = 88, lookBody = 114, lookLegs = 88, lookFeet = 88, lookAddons = 2})
conditionBlue:setParameter(CONDITION_PARAM_TICKS, -1)

function onStepIn(creature, item, position, fromPosition)
    local player = creature:getPlayer(cid)
    if not player then
        return false
    end

    -- setting storage 0
    if Game.getStorageValue(140400) < 1 then
        Game.setStorageValue(140400, 0)
    end

    player:addCondition(conditionBlue)
    Game.setStorageValue(140400, Game.getStorageValue(140400) + 1)
    Game.broadcastMessage(string.format('%s has joined the DotA! [%s/100].', player:getName(), Game.getStorageValue(140400)), MESSAGE_STATUS_WARNING)
    
    return true
end
 
Last edited:
The color is installed but I'm getting this error
Lua:
Lua Script Error: [MoveEvents Interface]
data/movements/scripts/eventos/blue.lua:onStepIn
data/movements/scripts/eventos/blue.lua:10: attempt to perform arithmetic on a n
il value
stack traceback:
        [C]: in function '__add'
        data/movements/scripts/eventos/blue.lua:10: in function <data/movements/
scripts/eventos/blue.lua:4>
        [C]: in function 'doTeleportThing'
        data/movements/scripts/eventos/dota.lua:7: in function <data/movements/s
cripts/eventos/dota.lua:1>
 
The color is installed but I'm getting this error
Lua:
Lua Script Error: [MoveEvents Interface]
data/movements/scripts/eventos/blue.lua:onStepIn
data/movements/scripts/eventos/blue.lua:10: attempt to perform arithmetic on a n
il value
stack traceback:
        [C]: in function '__add'
        data/movements/scripts/eventos/blue.lua:10: in function <data/movements/
scripts/eventos/blue.lua:4>
        [C]: in function 'doTeleportThing'
        data/movements/scripts/eventos/dota.lua:7: in function <data/movements/s
cripts/eventos/dota.lua:1>
verify if you copied my script in the post above

dota.lua
Lua:
function onStepIn(creature, item, position, fromPosition)
local player = creature:getPlayer(cid)
if not player then
return false
end
local positions = {
Position(691, 42, 7),
Position(595, 42, 7)
}
player:teleportTo(math.random(#positions), true)
player:getPosition():sendMagicEffect(10)
return true
end
 
verify if you copied my script in the post above
I did as you were commanded
The tile the player stands on to go to the event no longer works
Lua:
Lua Script Error: [MoveEvents Interface]
data/movements/scripts/eventos/dota.lua:onStepIn
attempt to index a number value
stack traceback:
        [C]: at 0x013f7c2170
        [C]: in function 'teleportTo'
        data/movements/scripts/eventos/dota.lua:10: in function <data/movements/
scripts/eventos/dota.lua:1>
 
I did as you were commanded
The tile the player stands on to go to the event no longer works[/CODE]


Lua:
function onStepIn(creature, item, position, fromPosition)
        local player = creature:getPlayer(cid)
        if not player then
                return false
        end
        local positions = {
                Position(691, 42, 7),
                Position(595, 42, 7)
        }
        local random = positions[math.random(#positions)]
        player:teleportTo(random, true)
        random:getPosition():sendMagicEffect(10)
        return true
end
 
The event works but the color doesn't change and it shows me this error
Lua:
Lua Script Error: [MoveEvents Interface]
data/movements/scripts/eventos/blue.lua:onStepIn
data/movements/scripts/eventos/blue.lua:12: attempt to compare nil with number
stack traceback:
        [C]: in function '__lt'
        data/movements/scripts/eventos/blue.lua:12: in function <data/movements/
scripts/eventos/blue.lua:5>
        [C]: in function 'teleportTo'
        data/movements/scripts/eventos/dota.lua:11: in function <data/movements/
scripts/eventos/dota.lua:1>

Lua Script Error: [MoveEvents Interface]
data/movements/scripts/eventos/dota.lua:onStepIn
data/movements/scripts/eventos/dota.lua:12: attempt to call method 'getPosition'
 (a nil value)
stack traceback:
        [C]: in function 'getPosition'
        data/movements/scripts/eventos/dota.lua:12: in function <data/movements/
scripts/eventos/dota.lua:1>
 
@Madusa

Blue.lua
Lua:
local conditionBlue = Condition(CONDITION_OUTFIT)
conditionBlue:setOutfit({lookType = 128, lookHead = 88, lookBody = 114, lookLegs = 88, lookFeet = 88, lookAddons = 2})
conditionBlue:setParameter(CONDITION_PARAM_TICKS, -1)


function onStepIn(creature, item, position, fromPosition)
    local player = creature:getPlayer()
    if not player then
        return false
    end

    -- setting storage 0
    if Game.getStorageValue(140400) == -1 then
        Game.setStorageValue(140400, 0)
    end

    player:addCondition(conditionBlue)
    Game.setStorageValue(140400, Game.getStorageValue(140400) + 1)
    Game.broadcastMessage(string.format('%s has joined the DotA! [%s/100].', player:getName(), Game.getStorageValue(140400)), MESSAGE_STATUS_WARNING)
 
    return true
end


Dota.lua

Lua:
local positions = {
       {x = 691, y = 42, z = 7},
       {x = 595, y = 42, z = 7}
}

function onStepIn(creature, item, position, fromPosition)
        local player = creature:getPlayer()
        if not player then
                return false
        end

        local randomPos = positions[math.random(#positions)]
        player:teleportTo(randomPos, true)
        randomPos:getPosition():sendMagicEffect(10)
        return true
end
 
Last edited:
Sorry for wasting your time, I'm starting to get bored with that event
Lua:
Lua Script Error: [MoveEvents Interface]
data/movements/scripts/eventos/blue.lua:onStepIn
data/movements/scripts/eventos/blue.lua:18: attempt to perform arithmetic on a n
il value
stack traceback:
        [C]: in function '__add'
        data/movements/scripts/eventos/blue.lua:18: in function <data/movements/
scripts/eventos/blue.lua:6>
        [C]: in function 'teleportTo'
        data/movements/scripts/eventos/dota.lua:13: in function <data/movements/
scripts/eventos/dota.lua:6>

Lua Script Error: [MoveEvents Interface]
data/movements/scripts/eventos/dota.lua:onStepIn
data/movements/scripts/eventos/dota.lua:14: attempt to call method 'getPosition'
 (a nil value)
stack traceback:
        [C]: in function 'getPosition'
        data/movements/scripts/eventos/dota.lua:14: in function <data/movements/
scripts/eventos/dota.lua:6>
 
First, go into globalevents, and search for the startup.lua script and insert this line After "function onStartup()":
Lua:
Game.setStorageValue(140400, 0)

Blue.lua
Lua:
local conditionBlue = Condition(CONDITION_OUTFIT)
conditionBlue:setOutfit({lookType = 128, lookHead = 88, lookBody = 114, lookLegs = 88, lookFeet = 88, lookAddons = 2})
conditionBlue:setParameter(CONDITION_PARAM_TICKS, -1)

function onStepIn(creature, item, position, fromPosition)
    local player = creature:getPlayer()
    if not player then
        return false
    end

    player:addCondition(conditionBlue)
    Game.setStorageValue(140400, Game.getStorageValue(140400) + 1)
    Game.broadcastMessage(string.format('%s has joined the DotA! [%s/100].', player:getName(), Game.getStorageValue(140400)), MESSAGE_STATUS_WARNING)

    return true
end


Dota.lua
Lua:
local positions = {
       {x = 691, y = 42, z = 7},
       {x = 595, y = 42, z = 7}
}

function onStepIn(creature, item, position, fromPosition)
        local player = creature:getPlayer()
        if not player then
                return false
        end

        local randomPos = positions[math.random(#positions)]
        player:teleportTo(randomPos, true)
        player:getPosition():sendMagicEffect(CONST_ME_TELEPORT)

        return true
end
 
Back
Top