• 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+ Boss Room tfs1.3

jel

Member
Joined
Mar 22, 2014
Messages
302
Reaction score
12
hello clan, i need a script in movements where the player can only pass in tp if in the area that tp takes he has a monster and he can only enter tp again after an hour, he will be kicked out of the saddle after 10 minutes.

I hope you help me thank you
 
edit this script as described above?

Lua:
local config = {
    centerRoom = Position(33353, 31350, 7),
    bossPosition = Position(33353, 31350, 7),
    newPosition = Position(33353, 31350, 7)
}

local function clearForgottenLloyd()
    local spectators = Game.getSpectators(config.centerRoom, false, false, 15, 15, 15, 15)
    for i = 1, #spectators do
        local spectator = spectators[i]
        if spectator:isPlayer() then
            spectator:teleportTo(Position(32815, 32873, 13))
            spectator:getPosition():sendMagicEffect(CONST_ME_TELEPORT)
            spectator:say('Time out! You were teleported out by strange forces.', TALKTYPE_MONSTER_SAY)
        elseif spectator:isMonster() then
            spectator:remove()
        end
    end
end

function onStepIn(player, item, fromPosition, target, toPosition, isHotkey)
     local player = creature:getPlayer()
    if not player then
        return
    end
        local specs, spec = Game.getSpectators(config.centerRoom, false, false, 15, 15, 15, 15)
        for i = 1, #specs do
            spec = specs[i]
            if spec:isPlayer() then
                player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "Someone is fighting with Lloyd.")
                return true
            end
        Game.createMonster("lloyd", config.bossPosition, true, true)
                if player:getStorageValue(Storage.ForgottenKnowledge.LloydTimer) < os.time() then
                    player:getPosition():sendMagicEffect(CONST_ME_POFF)
                    player:teleportTo(config.newPosition)
                    player:getPosition():sendMagicEffect(CONST_ME_TELEPORT)
                    player:setStorageValue(Storage.ForgottenKnowledge.LloydTimer, os.time() + 20 * 3600)
                else
                    player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You need to wait a while, recently someone challenge Lloyd.")
                    return true
        end
        addEvent(clearForgottenLloyd, 30 * 60 * 1000)
    end
    return true
end
 
Back
Top