gianflogao
Member
- Joined
- Jun 6, 2014
- Messages
- 134
- Solutions
- 2
- Reaction score
- 13
Lua:
function onUse(cid, item, fromPosition, itemEx, toPosition)
local pos = {
bigruby = { x = 1027, y = 1011, z = 5, stackpos = 2 }, -- Big Ruby
bigemerald = { x = 1028, y = 1011, z = 5, stackpos = 2 }, -- Big Emerald
blesssed = { x = 1029, y = 1011, z = 5, stackpos = 2 }, -- Blessed Shield
violetgem = { x = 1027, y = 1014, z = 5, stackpos = 2 }, -- Violet Gem
yellowgem = { x = 1028, y = 1014, z = 5, stackpos = 2 }, -- Yellow Gem
handaxe = { x = 1029, y = 1014, z = 5, stackpos = 2 }, -- Hand Axe
full = { x = 1029, y = 1012, z = 5, stackpos = 2 } -- Where FULL HOTA spawns
}
local ids = {
bigruby_ = 2156, -- Big Ruby ID
bigemerald_ = 2155, -- Big Emerald ID
blesssed_ = 2523, -- Blessed Shield ID
violetgem_ = 2153, -- Violet Gem ID
yellowgem_ = 2154, -- Yellow Gem ID
handaxe_ = 2380, -- Hand Axe ID
full_ = 2343 -- FULL HOTA ID
}
if(item.itemid == 1945) then
local bigruby = getThingFromPos(pos.bigruby)
local bigemerald = getThingFromPos(pos.bigemerald)
local blesssed = getThingFromPos(pos.blesssed)
local violetgem = getThingFromPos(pos.violetgem)
local yellowgem = getThingFromPos(pos.yellowgem)
local handaxe = getThingFromPos(pos.handaxe)
if(bigruby.itemid ~= ids.bigruby_) then
doPlayerSendCancel(cid, "Place the big ruby on the correct spot.")
elseif(bigemerald.itemid ~= ids.bigemerald_) then
doPlayerSendCancel(cid, "Place the big emerald on the correct spot.")
elseif(blesssed.itemid ~= ids.blesssed_) then
doPlayerSendCancel(cid, "Place the blessed shield on the correct spot.")
elseif(violetgem.itemid ~= ids.violetgem_) then
doPlayerSendCancel(cid, "Place the violet gem on the correct spot.")
elseif(yellowgem.itemid ~= ids.yellowgem_) then
doPlayerSendCancel(cid, "Place the yellow gem on the correct spot.")
elseif(handaxe.itemid ~= ids.handaxe_) then
doPlayerSendCancel(cid, "Place the hand axe on the correct spot.")
else
doRemoveItem(bigruby.uid, 1)
doRemoveItem(bigemerald.uid, 1)
doRemoveItem(blesssed.uid, 1)
doRemoveItem(violetgem.uid, 1)
doRemoveItem(yellowgem.uid, 1)
doRemoveItem(handaxe.uid, 1)
doCreateItem(ids.full_, pos.full)
doSendMagicEffect(pos.bigruby,2)
doSendMagicEffect(pos.bigemerald,2)
doSendMagicEffect(pos.blesssed,2)
doSendMagicEffect(pos.violetgem,2)
doSendMagicEffect(pos.yellowgem,2)
doSendMagicEffect(pos.handaxe_,2)
doSendMagicEffect(pos.full,2)
doPlayerSendTextMessage(cid,22, "You have enchanted your helmet of the ancients!")
doTransformItem(item.uid, item.itemid + 1)
end
elseif(item.itemid == 1946) then
doTransformItem(item.uid, item.itemid - 1)
doSendMagicEffect(getCreaturePosition(cid),2)
end
return true
end
How do I make this language "simpler"?
This script is not working on my server.