konceptz
New Member
- Joined
- Apr 8, 2009
- Messages
- 17
- Reaction score
- 0
I was trying to make a script that checks if the player has an item on a certain coordinate and also check if all the monsters are dead in the area, if both checks are true then pulling the lever will cause the wall/stone to disappear. I have a script that does remove the stone if the player pays an item, I just dont' know how to incorporate the two checks =/
This is the script that I was able to find, however, giving me an error:
The error giving in the console is:
This is the script that I was able to find, however, giving me an error:
Code:
--- CONFIG START ---
local itemPos = {x=607, y=382, z=11} -- position of the "itemId"
local itemId = 6300 -- itemID required on "itemPos"
local monster = Minion of Oblivion -- only one monster name, the boss
local arenax = 569,607
local arenay = 378,386
local z = 11
local addItem = 5072 -- item being added couple of seconds after pulling the lever
local pos = {x=608, y=381, z=11, stackpos=1} -- position of the item being added and removed
---- CONFIG END ---
function m(cid)
isnofence = getGlobalStorageValue(9888)
if isnofence == 1 then
doCreateItem(addItem,1,pos)
setGlobalStorageValue(9888, -1)
end
end
function onUse(cid, item, frompos, item2, topos)
if item.uid == 9888 and item.itemid == 1945 then
Apo = 0
playersInArena = 0;
for arenax = arenax do
for arenay = arenay do
arenapos = {x=arenax, y=arenay, z=z, stackpos=253}
arenacreature = getThingfromPos(arenapos)
if isPlayer(arenacreature.uid) == 1 then
playersInArena = playersInArena + 1
elseif isCreature(arenacreature.uid) == 1 then
if getCreatureName(arenacreature.uid) == "monster" then
Apo = 1
end
end
end
end
if Apo == 0 then
local thing = getTileItemById(itemPos, itemId)
if thing.uid > 0 then
isnofence = getGlobalStorageValue(9888)
get1 = getThingfromPos(pos)
if isnofence == -1 then
doRemoveItem(get1.uid,1)
setGlobalStorageValue(9888, 1)
addEvent(m,30000,cid)
end
else
doPlayerSendCancel(cid, "Defeat your enemy first!")
end
doTransformItem(item.uid,1946)
elseif item.uid == 9888 and item.itemid == 1946 then
doTransformItem(item.uid,1945)
else
return 0
end
return 1
end
function getTileItemById(pos, itemid)
pos.stackpos = 0
local thing = getThingfromPos(pos)
while thing.uid > 0 and thing.itemid ~= itemid do
pos.stackpos = pos.stackpos + 1
thing = getThingfromPos(pos)
end
return thing
end
The error giving in the console is:
Code:
data/actions/scripts/quests/oblivionminion.lua:4: '=' expected near 'Oblivion'
Last edited: