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

help with this script please!

kymurax

New Member
Joined
Dec 29, 2009
Messages
53
Reaction score
0
I have the following script

local c = {
exhaust = 13950, -- Storage Value que gustes.
minutes = 5, -- Minutos que transcurrirán hasta que se pueda volver a crear otro monstruo.
monster = {'Cat', 'Chicken', 'Dog'}, -- 'Nombre' del monstruo que aparecerá. (Si son más de uno, cada uno separado por una coma.)
effects = {
norm = CONST_ME_TELEPORT, -- Efecto mágico normal que aparecerá en el monstruo.
dist = CONST_ANI_EXPLOSION, -- Efecto mágico de a distancia que aparecerá desde el suelo pisado hasta el monstruo.
},
}

function onStepIn(cid, item, position, fromPosition, toPosition)
if isPlayer(cid) then
local position = getClosestFreeTile(cid, fromPosition)
if not position then
return doPlayerSendDefaultCancel(cid, RETURNVALUE_NOTENOUGHROOM) and true
end
if os.time(t) > getGlobalStorageValue(c.exhaust) then
setGlobalStorageValue(c.exhaust, (os.time() + (c.minutes * 60)))
for i = 1, #c.monster do
local summon = doCreateMonster (c.monster, position, true)
if not isCreature(summon) then
doPlayerSendDefaultCancel(cid, RETURNVALUE_NOTENOUGHROOM)
break
end
doSendMagicEffect (getThingPos(summon), c.effects.norm)
doSendDistanceShoot(fromPosition, getThingPos(summon), c.effects.dist)
end
else
doPlayerSendCancel(cid, 'It is exhausted for ' .. timeString(getGlobalStorageValue(c.exhaust) - os.time()) .. '.')
end
end
return true
end



and he send me this error

9:36:18.263] [Error - MoveEvents Interface]
[9:36:18.271] data/movements/scripts/tileMonster.lua:eek:nStepIn
[9:36:18.271] Description:
[9:36:18.272] data/movements/scripts/tileMonster.lua:17: field 'day' missing in date table
[9:36:18.272] stack traceback:
[9:36:18.273] [C]: in function 'time'
[9:36:18.273] data/movements/scripts/tileMonster.lua:17: in function


can someone help me?
 
Lua:
local c = {
    exhaust = 13950, -- Storage Value que gustes.
    minutes = 5, -- Minutos que transcurrirán hasta que se pueda volver a crear otro monstruo.
    monster = {'Cat', 'Chicken', 'Dog'}, -- 'Nombre' del monstruo que aparecerá. (Si son más de uno, cada uno separado por una coma.)
    effects = {
    norm = CONST_ME_TELEPORT, -- Efecto mágico normal que aparecerá en el monstruo.
    dist = CONST_ANI_EXPLOSION, -- Efecto mágico de a distancia que aparecerá desde el suelo pisado hasta el monstruo.
}
}

function onStepIn(cid, item, position, fromPosition, toPosition)
    if isPlayer(cid) then
        local position = getClosestFreeTile(cid, fromPosition)
       
    if not position then
        return doPlayerSendDefaultCancel(cid, RETURNVALUE_NOTENOUGHROOM) and true
    end
   
    if os.time() > getGlobalStorageValue(c.exhaust) then
        setGlobalStorageValue(c.exhaust, (os.time() + (c.minutes * 60)))
            for i = 1, #c.monster do
            local summon = doCreateMonster (c.monster, position, true)
           
            if not isCreature(summon) then
                doPlayerSendDefaultCancel(cid, RETURNVALUE_NOTENOUGHROOM)
            break
            end
                doSendMagicEffect (getThingPos(summon), c.effects.norm)
                doSendDistanceShoot(fromPosition, getThingPos(summon), c.effects.dist)
            end
    else
        doPlayerSendCancel(cid, 'It is exhausted for ' .. timeString(getGlobalStorageValue(c.exhaust) - os.time()) .. '.')
    end
end
return true
end
 
Back
Top