Micool777
New Member
- Joined
- Aug 25, 2012
- Messages
- 14
- Reaction score
- 0
LUA:
local fromPos={x = 110, y = 78, z = 0}
local toPos={x = 116, y = 84, z = 0}
local firstpos={x = 113, y = 81, z = 6} --<very first lever beginning quest positions
local secondpos={x = 116, y = 84, z = 6} -->
function onUse(cid, item, fromPosition, itemEx, toPosition)
local currentlevel = fromPosition.z
if (item.itemid==1945) then
if not isPlayer(cid) then
return true
end
local amount = 0
--
for xx = firstpos.x, secondpos.x do
for yy = firstpos.y, secondpos.y do
for zz = firstpos.z, secondpos.z do
--
for x = fromPos.x, toPos.x do
for y = fromPos.y, toPos.y do
for z = fromPos.z + currentlevel, toPos.z + currentlevel do
--
if (currentlevel ~= 6) then
local pid = getThingfromPos({x=x,y=y,z=z}).uid
elseif (currentlevel == 6) then
local pid = getThingfromPos({x=xx,y=yy,z=zz}).uid
end
if (isCreature(pid) and pid>0) then
amount = amount+1
--doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, pid)
else
end
end
end
end
end
end
--
end
[[[[40]]]] if (amount=0 and item.uid~=15006 or item.uid~=15002) then
fromPosition.z=fromPosition.z-1
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Congratulations on defeating the Demon Gods! Only "..currentlevel-3.." levels to go!")
elseif (item.uid == 15002 and amount=0) then
doTeleportThing(cid, {x = 113, y = 81, z = 7}, FALSE)
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You have entered the lair of the Demon Gods... I wish you luck.")
elseif (item.uid == 15006 and amount=0) then
doTeleportThing(cid, {x = 113, y = 85, z = 11}, FALSE)
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You have defeated all of the Demon Gods! Proceed to the chest to receive your reward.")
else
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "There are/is still "..amount.." Demon God(s) left. You must defeat all of them before you can proceed.")
end
end
end
Error at line 40 - ')' expected near '='... I really don't see the problem in that if statement. I have tried many variations, but all have failed
Last edited by a moderator: