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

pick one of six

Quickshot

Member
Joined
Nov 8, 2008
Messages
595
Reaction score
8
hi i need a script that alows you to only pick one chest item out of the 6 of them. rep ++
also i use latest tfs
 
Last edited:
If you get uid duplicate errors (which you should get) you could use this:
LUA:
function onUse(cid, item, fromPosition, itemEx, toPosition)
local storage = 1337
local items = {
		[5000] = {itemID = 2160, count = 100}, -- Chest UID = 5000
		[5001] = {itemID = 2160, count = 57}, -- Chest UID = 5001
		[5002] = {itemID = 2476, count = 1}, -- Chest UID = 5002
		[5003] = {itemID = 2476, count = 1}, -- Chest UID = 5003 
		[5004] = {itemID = 2160, count = 100}, -- Chest UID = 5004
		[5005] = {itemID = 2160, count = 100} -- Chest UID = 5005
		}
		
	if getPlayerStorageValue(cid, storage) <= 0 then
		if items[item.uid].count == 1 then
			doPlayerSendTextMessage(cid, 22, "You found a " .. getItemNameById(items[item.uid].itemID) .. ".")
		else
			doPlayerSendTextMessage(cid, 22, "You found " .. items[item.uid].count .. " " .. getItemNameById(items[item.uid].itemID) .. "s.")
		end
		doPlayerAddItem(cid, items[item.uid].itemID, items[item.uid].count)
		setPlayerStorageValue(cid, storage, 1)
	else
		doPlayerSendCancel(cid, "You have already made this quest.")
	end
return true
end

Not tested.
 
Last edited:
Back
Top