Ir para conteúdo

Erro no lentitud.lua e no save


guromk

Posts Recomendados

servidor: pokemon dash PxVzla

dificuldade: médio

 

​Alguém sabe resolver este erros:

 

1: lentitud:

 

no console aparece isso:

 

[31/03/2014 17:44:36] [Error - LuaScriptInterface::loadFile] data/movements/scripts/lentitud.lua:41: 'end' expected (to close 'if' at line 32) near '<eof>'

[31/03/2014 17:44:36] [Warning - Event::loadScript] Cannot load script (data/movements/scripts/lentitud.lua)
[31/03/2014 17:44:36] data/movements/scripts/lentitud.lua:41: 'end' expected (to close 'if' at line 32) near '<eof>'
[31/03/2014 17:44:36] [Error - LuaScriptInterface::loadFile] data/movements/scripts/lentitud.lua:41: 'end' expected (to close 'if' at line 32) near '<eof>'
[31/03/2014 17:44:36] [Warning - Event::loadScript] Cannot load script (data/movements/scripts/lentitud.lua)
[31/03/2014 17:44:36] data/movements/scripts/lentitud.lua:41: 'end' expected (to close 'if' at line 32) near '<eof>'

script:lentitud.lua

function onStepIn(cid, item, position, fromPosition)

local underwater = {1006}
local checkpos = fromPosition
checkpos.stackpos = 0
if isInArray(underwater, getTileInfo(checkpos).itemid) then
if not isPlayer(cid) then
return true
end
if isPlayer(cid) and getCreatureOutfit(cid).lookType == 814 then return false end
if getPlayerStorageValue(cid, 15) >= 1 then
setPlayerStorageValue(cid,18,1)
if getPlayerSex(cid) == 0 then
doSetCreatureOutfit(cid, {lookType = 1034, lookHead = getCreatureOutfit(cid).lookHead, lookBody = getCreatureOutfit(cid).lookBody, lookLegs = getCreatureOutfit(cid).lookLegs, lookFeet = getCreatureOutfit(cid).lookFeet}, -1)
elseif getPlayerSex(cid) == 1 then
doSetCreatureOutfit(cid, {lookType = 1035, lookHead = getCreatureOutfit(cid).lookHead, lookBody = getCreatureOutfit(cid).lookBody, lookLegs = getCreatureOutfit(cid).lookLegs, lookFeet = getCreatureOutfit(cid).lookFeet}, -1)
end
end
if getPlayerStorageValue(cid, 15) < 1 then
local speed = getCreatureSpeed(cid)
doChangeSpeed(cid, -speed)
doChangeSpeed(cid, 90)
elseif getPlayerStorageValue(cid, 15) > 1 then
local speed = getCreatureSpeed(cid)
doChangeSpeed(cid, -speed)
doChangeSpeed(cid, 300)
end
function onStepOut(cid, item, position, fromPosition)
local underwater = {1006}
local checkpos = fromPosition
checkpos.stackpos = 0
if isInArray(underwater, getTileInfo(checkpos).itemid) then
if not isPlayer(cid) then
return false
end
if isPlayer(cid) and getCreatureOutfit(cid).lookType == 814 then return false end
doRegainSpeed(cid)
if getPlayerStorageValue(cid, 18) >= 1 then
setPlayerStorageValue(cid,18,0)
doRemoveCondition(cid, CONDITION_OUTFIT)
end .

movements.xml

<movevent type="StepIn" itemid="1006" event="script" value="lentitud.lua"/>

<movevent type="StepOut" itemid="1006" event="script" value="lentitud.lua"/> .

2º erro é no save:
no console:

[31/03/2014 18:04:38] > Broadcasted message: "Se hara un save en 30 seconds, porfavor espera el freeze.".

[31/03/2014 18:04:38] [Error - GlobalEvents::think] Couldn't execute event: save
[31/03/2014 18:05:08] [Error - GlobalEvent Interface]
[31/03/2014 18:05:08] In a timer event called from:
[31/03/2014 18:05:08] data/globalevents/scripts/save.lua:onThink
[31/03/2014 18:05:08] Description:
[31/03/2014 18:05:08] (luaAddEvent) Callback parameter should be a function.

script:save.lua

-- Local config

local timetosave = 30000 -- It's time to save after broadcast, delay 30 seconds
local delay = 5000 -- It's time to save odd after pair, delay 5 seconds
local function doSavePlayerAndHouse(cid)
doPlayerSave(cid)
doSaveHouse({getHouseByPlayerGUID(getPlayerGUID(cid))})
return true
end
local function save()
for _, cid in ipairs(getPlayersOnline()) do
if getPlayerGUID(cid) % 2 == 0 then
doSavePlayerAndHouse(cid)
else
addEvent(savesavePlayer, delay, cid)
end
end
end
local function savePlayer(cid)
doSavePlayerAndHouse(cid)
return true
end
function onThink(interval, lastExecution, thinkInterval)
addEvent(save, timetosave)
doBroadcastMessage("Se hara un save en 30 seconds, porfavor espera el freeze.")
end

globalevents.xml:

<?xml version="1.0" encoding="UTF-8"?>

<globalevents>
<globalevent name="animatedtexto" interval%
Editado por guromk
Link para o comentário
Compartilhar em outros sites

×
×
  • Criar Novo...