cesar ramirez
New Member
- Joined
- Jul 26, 2018
- Messages
- 3
- Reaction score
- 0
Hello i had this error trying to make a script by myself modifing other ones
What im trying to do its In the map are 7 altars were you need to put one piece of ancient helmet in each altar; when you use the leaver, it deletes the items and put in your bag the ancient helmet and teleporting you to the temple.
Code:
local pos = {
altar1 = Position({x=581, y=189, z=8}),
altar2 = Position({x=583, y=192, z=8}),
altar3 = Position({x=582, y=193, z=8}),
altar4 = Position({x=581, y=193, z=8}),
altar5 = Position({x=580, y=193, z=8}),
altar6 = Position({x=579, y=192, z=8}),
altar7 = Position({x=589, y=194, z=8}),
stand = Position({x = 581, y = 191, z = 8}),
teleportTo = Position({x = 615, y = 212, z = 7})
}
function onUse(creature, item, fromPosition, target, toPosition, isHotkey)
if item.itemid == 1945 and creature:isPlayer() then
local topItem = Tile(pos.altar1):getTopVisibleThing(creature)
if topItem.itemid == 2335 then
local topItem = Tile(pos.altar2):getTopVisibleThing(creature)
if topItem.itemid == 2336 then
local topItem = Tile(pos.altar3):getTopVisibleThing(creature)
if topItem.itemid == 2337 then
local topItem = Tile(pos.altar4):getTopVisibleThing(creature)
if topItem.itemid == 2338 then
local topItem = Tile(pos.altar5):getTopVisibleThing(creature)
if topItem.itemid == 2339 then
local topItem = Tile(pos.altar6):getTopVisibleThing(creature)
if topItem.itemid == 2340 then
local topItem = Tile(pos.altar7):getTopVisibleThing(creature)
if topItem.itemid == 2341 then
if creature:getPosition():getDistance(pos.stand) == 0 then
topItem:remove()
creature:sendTextMessage(MESSAGE_INFO_DESCR, "You Assemble the Ancient Helmet")
doPlayerAddItem(cid,2342,1)
creature:teleportTo(pos.teleportTo)
end
end
end
end
end
end
end
end
end
return true
end
What im trying to do its In the map are 7 altars were you need to put one piece of ancient helmet in each altar; when you use the leaver, it deletes the items and put in your bag the ancient helmet and teleporting you to the temple.