Xavicrak
New Member
- Joined
- Mar 23, 2010
- Messages
- 186
- Reaction score
- 4
Hello I am trying to make poi levers in order, but my script dont work and i can't fix it, can anybody help me? (I USE TFS0.4)
here is the info:
CONSOLE ERROR:
[ERROR - LuaInterface::loadFile] data/actions/scripts... : 40: '<eof>' expected near 'elseif'
[Warning - Event: loadScript] Cannot load script <data/actions/scripts/Pits...>
data/actions/scripts/Pits...:40 '<eof>' expected near 'elseif'
SCRIPT:
here is the info:
CONSOLE ERROR:
[ERROR - LuaInterface::loadFile] data/actions/scripts... : 40: '<eof>' expected near 'elseif'
[Warning - Event: loadScript] Cannot load script <data/actions/scripts/Pits...>
data/actions/scripts/Pits...:40 '<eof>' expected near 'elseif'
SCRIPT:
HTML:
-- Script by Xavicrak POI LEVERS 1
local STORAGE_QUEST = 532154
levers =
{
leverpos1 = {x=481, y=1387, z=11, stackpos=1}, leverpos2 = {x=498, y=1381, z=13, stackpos=1}, leverpos3 = {x=450, y=1405, z=13, stackpos=1},
leverpos4 = {x=496, y=1402, z=14, stackpos=1}, leverpos5 = {x=494, y=1383, z=11, stackpos=1}, leverpos6 = {x=453, y=1371, z=11, stackpos=1},
leverpos7 = {x=494, y=1408, z=12, stackpos=1}, leverpos8 = {x=460, y=1412, z=13, stackpos=1}, leverpos9 = {x=450, y=1412, z=11, stackpos=1},
leverpos10 = {x=454, y=1385, z=12, stackpos=1}, leverpos11 = {x=493, y=1390, z=12, stackpos=1}, leverpos12 = {x=481, y=1418, z=12, stackpos=1},
leverpos13 = {x=457, y=1419, z=12, stackpos=1}, leverpos14 = {x=467, y=1417, z=12, stackpos=1}, leverpos15 = {x=481, y=1407, z=13, stackpos=1},
wall1 = {x=458, y=1386, z=11, stackpos=1}, wall2 = {x=459, y=1386, z=11, stackpos=1}
}
cfg =
{
lever1 = getThingfromPos(levers.leverpos1), lever2 = getThingfromPos(levers.leverpos2), lever3 = getThingfromPos(levers.leverpos3),
lever4 = getThingfromPos(levers.leverpos4), lever5 = getThingfromPos(levers.leverpos5), lever6 = getThingfromPos(levers.leverpos6),
lever7 = getThingfromPos(levers.leverpos7), lever8 = getThingfromPos(levers.leverpos8), lever9 = getThingfromPos(levers.leverpos9),
lever10 = getThingfromPos(levers.leverpos10), lever11 = getThingfromPos(levers.leverpos11), lever12 = getThingfromPos(levers.leverpos12),
lever13 = getThingfromPos(levers.leverpos13), lever14 = getThingfromPos(levers.leverpos14), lever15 = getThingfromPos(levers.leverpos15),
wall = getThingfromPos(levers.wall1), wallb = getThingfromPos(levers.wall2)
}
MISSION_STORE = 10284
local MISSION_STATUS = math.max(getGlobalStorageValue(MISSION_STORE),0)
function onUse(cid, item, frompos, item2, topos)
if cfg.lever1.itemid == 1945 and cfg.lever1.uid == 10316 then
if MISSION_STATUS == 0 then
doTransformItem(item.uid,1946,1)
setGlobalStorageValue(MISSION_STORE, MISSION_STATUS + 1)
doSendPlayerTextMessage(cid,22,"lever 1 gogo!")
elseif MISSION_STATUS ~= 0 then
doTransformItem(item.uid,1945)
setGlobalStorageValue(MISSION_STORE, 0)
end
else
SendPlayerCancel(cid, "Sorry not possible.")
end
elseif cfg.lever2.itemid == 1945 and cfg.lever2.uid == 10315 then
if MISSION_STATUS == 1 then
doTransformItem(item.uid,1946,1)
setGlobalStorageValue(MISSION_STORE, MISSION_STATUS + 1)
elseif MISSION_STATUS ~= 1 then
doTransformItem(item.uid,1945)
setGlobalStorageValue(MISSION_STORE, 0)
end
else
SendPlayerCancel(cid, "Sorry not possible.")
end
elseif cfg.lever3.itemid == 1945 and cfg.lever3.uid == 10314 then
if MISSION_STATUS == 2 then
doTransformItem(item.uid,1946,1)
setGlobalStorageValue(MISSION_STORE, MISSION_STATUS + 1)
elseif MISSION_STATUS ~= 2 then
doTransformItem(item.uid,1945)
setGlobalStorageValue(MISSION_STORE, 0)
end
else
SendPlayerCancel(cid, "Sorry not possible.")
end
elseif cfg.lever4.itemid == 1945 and cfg.lever4.uid == 10313 then
if MISSION_STATUS == 3 then
doTransformItem(item.uid,1946,1)
setGlobalStorageValue(MISSION_STORE, MISSION_STATUS + 1)
elseif MISSION_STATUS ~= 3 then
doTransformItem(item.uid,1945)
setGlobalStorageValue(MISSION_STORE, 0)
end
else
SendPlayerCancel(cid, "Sorry not possible.")
end
elseif cfg.lever5.itemid == 1945 and cfg.lever5.uid == 10312 then
if MISSION_STATUS == 4 then
doTransformItem(item.uid,1946,1)
setGlobalStorageValue(MISSION_STORE, MISSION_STATUS + 1)
elseif MISSION_STATUS ~= 4 then
doTransformItem(item.uid,1945)
setGlobalStorageValue(MISSION_STORE, 0)
end
else
SendPlayerCancel(cid, "Sorry not possible.")
end
elseif cfg.lever6.itemid == 1945 and cfg.lever6.uid == 10311 then
if MISSION_STATUS = 5 then
doTransformItem(item.uid,1946,1)
setGlobalStorageValue(MISSION_STORE, MISSION_STATUS + 1)
if MISSION_STATUS ~= 5 then
doTransformItem(item.uid,1945)
setGlobalStorageValue(MISSION_STORE, 0)
end
else
SendPlayerCancel(cid, "Sorry not possible.")
end
elseif cfg.lever7.itemid == 1945 and cfg.lever7.uid == 10310 then
if MISSION_STATUS = 6 then
doTransformItem(item.uid,1946,1)
setGlobalStorageValue(MISSION_STORE, MISSION_STATUS + 1)
elseif MISSION_STATUS ~= 6 then
doTransformItem(item.uid,1945)
setGlobalStorageValue(MISSION_STORE, 0)
end
else
SendPlayerCancel(cid, "Sorry not possible.")
end
elseif cfg.lever8.itemid == 1945 and cfg.lever8.uid == 10309 then
if MISSION_STATUS = 7 then
doTransformItem(item.uid,1946,1)
setGlobalStorageValue(MISSION_STORE, MISSION_STATUS + 1)
elseif MISSION_STATUS ~= 7 then
doTransformItem(item.uid,1945)
setGlobalStorageValue(MISSION_STORE, 0)
end
else
SendPlayerCancel(cid, "Sorry not possible.")
end
end
return 1
end