• 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!

Script lock item

setembro

New Member
Joined
May 22, 2008
Messages
110
Reaction score
1
I need a script where to use an item in some equip, the equip will be locked and can only be used by the owner who locked the item.


I ADD REP +++
 
something:
Exemple:

11:23 You see a golden helmet.
It weighs 32.00 oz.
It is the famous Helmet of the Stars. Item locked, only use by player name Lord Paulistinha.
 
Lua:
local s = 2912
function onEquip(cid, item, slot)
local a = (getItemAttribute(item.uid, 'aid')-7000)
if getItemAttribute(item.uid, 'aid') >= 1 then
	if getPlayerStorageValue(cid, s) ~= a then
		doPlayerSendCancel(cid, "Sorry, this does not belong to you")
	end
end
return FALSE
end

Lua:
function onUse(cid, item, fromPosition, itemEx, toPosition)
local t = {
	a = {1234, 3213, 3213, 341, 3213}, -- allowed items to lock
	b = (getGlobalStorageValue(2912)+7000)
}
if getItemAttribute(item.uid, 'aid') >= 1 then
	doPlayerSendCancel(cid, "Sorry, this item is already locked, if it's not locked please contact the owner")
end
	if isInArray(t.a, item.itemid) then
		doItemSetAttribute(item.uid, "aid", t.b)
		doPlayerSetStorageValue(cid, 2912, (getGlobalStroageValue(2912))
		doItemSetAttribute(item.uid, "name", getItemInfo(item.itemid).name .. " that belongs to ".. getCreatureName(cid))
		doPlayerSendTextMessage(cid, 21, "This item has been marked as yours!")
		setGlobalStorageValue((b)+1)
	end
return TRUE
end

I doubt this will work, I made it in a hurry while looking at JDB's script so I maybe got confused and effed up the script.
 
Last edited:
Back
Top