• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!
  • New resources must be posted under Resources tab. A discussion thread will be created automatically, you can't open threads manually anymore.

Action Your very own LOOT backpack. No one can take your shit!

JDB

OtLand Veteran
Joined
Jun 1, 2009
Messages
4,145
Solutions
2
Reaction score
115
80187998.png


I tried to steal God's items, but I couldn't open the backpack. <_<

bp2.png


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:
it should be more like getItemAttribute(item.uid, "name").. " that belongs to "
but well I did'nt expected that it can be so simple
you can also make it moveable only for owner

@down: now its always backpack, what if I wanna own bag? it should get item name first
 
Last edited:
@down: now its always backpack, what if I wanna own bag? it should get item name first

Edited first post, thanks for the idea.
 
Last edited:
nice one, now what about u give me edron orcs and vengoth entrance :wub:
 
can make it for a players? and what changes are in backpack.lua? thanks in advance
 
Its a good one and criativity script. But, have some problems in-game, when this player will go died he put all the things in the backpack and than, no one can open it to get the equips..

anyway, nice work. Thanks.
 
Its a good one and criativity script. But, have some problems in-game, when this player will go died he put all the things in the backpack and than, no one can open it to get the equips..

anyway, nice work. Thanks.

Yeah, I noticed that. You can make an prepareDeath script to remove the unique id and action id. Or, leave it alone and players will toss in the Dustbin.
 
Back
Top Bottom