JDB
OtLand Veteran
- Joined
- Jun 1, 2009
- Messages
- 4,145
- Solutions
- 2
- Reaction score
- 115
I tried to steal God's items, but I couldn't open the backpack. <_<
Make the Backpack yours.
Code:
<action itemid="4851" event="script" value="own.lua"/>
own.lua
Code:
function onUse(cid, item, fromPosition, itemEx, toPosition)
if itemEx.actionid ~= 3070 then
[COLOR="red"]if isInArray({1988, 2365}, itemEx.itemid) then[/COLOR]
doItemSetAttribute(itemEx.uid, "aid", 3070)
doItemSetAttribute(itemEx.uid, "uid", getPlayerGUID(cid) + 1000)
doItemSetAttribute(itemEx.uid, "name", getItemInfo(itemEx.itemid).name .. " that belongs to ".. getCreatureName(cid))
doRemoveItem(item.uid)
else
doPlayerSendCancel(cid, "Sorry, not possible.")
end
else
doPlayerSendCancel(cid, "Sorry, not possible.")
end
return true
end
Opening the backpack.
Code:
<action actionid="3070" event="script" value="backpack.lua"/>
backpack.lua
Code:
function onUse(cid, item, fromPosition, itemEx, toPosition)
if item.actionid == 3070 then
if item.uid ~= getPlayerGUID(cid) + 1000 then
doPlayerSendCancel(cid, "Sorry, this backpack doesn't belong to you.")
return true
end
end
end
How to use these scripts.
1. Choose what backpacks are allowed to be owned.
Code:
if isInArray({1988, 2365}, itemEx.itemid) then
2. Use item id 4851 on the backpack.
Done!
Last edited: