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

Lua Time to use lever again

_M4G0_

Intermediate OT User
Joined
Feb 6, 2016
Messages
550
Solutions
17
Reaction score
108
someone can help to add time to use lever ?

script edited from annihilator quest

local config = {
requiredLevel = 2800,
daily = false,
playerPositions = {
Position(33503, 31579, 7),
Position(33503, 31580, 7),
Position(33503, 31581, 7),
Position(33503, 31582, 7)
},
newPositions = {
Position(33503, 31576, 8),
Position(33503, 31577, 8),
Position(33503, 31578, 8),
Position(33503, 31579, 8)
},

}

function onUse(player, item, fromPosition, target, toPosition, isHotkey)
if item.itemid == 1945 then
local storePlayers, playerTile = {}

for i = 1, #config.playerPositions do
playerTile = Tile(config.playerPositions):getTopCreature()
if not playerTile or not playerTile:isPlayer() then
player:sendTextMessage(MESSAGE_STATUS_SMALL, "You need 4 players.")
return true
end

if playerTile:getLevel() < config.requiredLevel then
player:sendTextMessage(MESSAGE_STATUS_SMALL, "All the players need to be level ".. config.requiredLevel .." or higher.")
return true
end

storePlayers[#storePlayers + 1] = playerTile
end
local players
for i = 1, #storePlayers do
players = storePlayers
config.playerPositions:sendMagicEffect(CONST_ME_POFF)
players:teleportTo(config.newPositions)
config.newPositions:sendMagicEffect(CONST_ME_ENERGYAREA)
players:setDirection(DIRECTION_EAST)
Game.createMonster("Demonio", {x = 33543, y = 31622, z = 8})
end
elseif item.itemid == 1945 then
if config.daily then
player:sendTextMessage(MESSAGE_STATUS_SMALL, Game.getReturnMessage(RETURNVALUE_NOTPOSSIBLE))
return true
end
end

item:transform(item.itemid == 1945 and 1945 or 1946)
return true
end
 
sorry, understand your example =x

i need, exemple:
if have one team in the room, the next time dont use the lever, and receive the mensage: you need wait X seconds for enter
Code:
if not globalStorageTable then
    globalStorageTable = {}
end

function Game.getStorageValue(key)
    return globalStorageTable[key]
end

function Game.setStorageValue(key, value)
    globalStorageTable[key] = value
end
 
Back
Top