alltus
Active Member
- Joined
- Aug 5, 2020
- Messages
- 49
- Reaction score
- 31
Hey guys, I'm using 10.98 FTS 1.2
I'm having a little problem with a code here. I want a chest with uID 60001 to give x,y,z items and, after that, stop giving the items.
But when I use the chest, it still giving me the items, and I don't know exactly what I should do here to fix it.
The code is:
I'm having a little problem with a code here. I want a chest with uID 60001 to give x,y,z items and, after that, stop giving the items.
But when I use the chest, it still giving me the items, and I don't know exactly what I should do here to fix it.
The code is:
Lua:
function onUse(cid, item, frompos, item2, topos)
if item.uid == 60001 then
queststatus = getPlayerStorageValue(cid, 60001)
if queststatus == -1 or queststatus == 0 then
for i = 1, 10 do
if getPlayerSlotItem(cid, i).itemid > 0 and i ~= 3 then
doPlayerSendTextMessage(cid, 22, "You must get rid of all your equipment!")
return false
end
end
doPlayerSendTextMessage(cid, 22, "You have obtained the Paladin Gear!")
doPlayerAddItem(cid,1988,1)
doPlayerAddItem(cid,2389,5)
doPlayerAddItem(cid,2456,1)
doPlayerAddItem(cid,2525,1)
doPlayerAddItem(cid,2544,100)
doPlayerAddItem(cid,2660,1)
doPlayerAddItem(cid,8923,1)
doPlayerAddItem(cid,2643,1)
doPlayerAddItem(cid,2461,1)
doPlayerSetStorage(cid,60001,1)
setPlayerStorageValue(cid, 60001, 1)
else
doPlayerSendTextMessage(cid, 22, "It is empty.")
end
else
return false
end
return true
end