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

Plz Fast need help whit rune

hansenjohan

New Member
Joined
Dec 20, 2008
Messages
56
Reaction score
0
Location
Halmstad
I have real Map server but is one problem!!

when i buy runes they only have 1 target so i can only use it 1 time and its gone.

how i fix so when i buy runes they have 20x not 1x.


Plx Need help Fast plx


"sorry for my english :p"
 
here is the script he have :
Code:
function onUse(cid, item, fromPosition, itemEx, toPosition)
	local shop = {
		[1016] = { 
			rune = 2268, container = 2003, cost = 5000, charges = 3, effect = CONST_ME_GIFT_WRAPS
		},
		[1015] = { 
			rune = 2269, container = 2002, cost = 3000, charges = 3, effect = CONST_ME_GIFT_WRAPS
		}
	}
	local v = shop[item.actionid]
	local weight = getItemWeightById(v.container, getContainerSize(v.container)) + getItemWeightById(v.container, 1)                    
	if(getPlayerFreeCap(cid) >= weight) then
		if(getPlayerMoney(cid) >= v.cost) then
			local bp = doCreateItemEx(cid, v.container, 1)
			doAddContainerItem(bp, v.rune, v.charges)
			if(doPlayerAddItemEx(cid, bp, true) ~= RETURNVALUE_NOERROR) then
				doPlayerSendCancel(cid, "Sorry, you do not have enough space.")
			else
				doPlayerRemoveMoney(cid, v.cost)
				doSendMagicEffect(getThingPos(cid), v.effect)
				doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You have purchased a backpack of " .. getItemNameById(v.rune) .. "'s.")
			end
		else
			doPlayerSendCancel(cid, "Sorry, you must have " .. v.cost .. " gold.")
		end
	else
		doPlayerSendCancel(cid, "Sorry, you need " .. math.ceil(weight) .. "oz. to carry this item.")
	end
	return doTransformItem(item.uid, item.itemid == 1945 and 1946 or 1945)
end
 
Code:
local shop = {
	[1016] = {
		rune = 2268, container = 2003, cost = 5000, charges = 3, effect = CONST_ME_GIFT_WRAPS
	},
	[1015] = {
		rune = 2269, container = 2002, cost = 3000, charges = 3, effect = CONST_ME_GIFT_WRAPS
	}
}
function onUse(cid, item, fromPosition, itemEx, toPosition)
	local v = shop[item.actionid]
	local weight = getItemWeightById(v.rune, tonumber(getItemInfo(v.container).maxItems)) + getItemWeightById(v.container, 1)
	if getPlayerFreeCap(cid) >= weight then
		if getPlayerMoney(cid) >= v.cost then
			local bp = doCreateItemEx(cid, v.container, 1)
			if doPlayerAddItemEx(cid, bp) ~= RETURNVALUE_NOERROR then
				return doPlayerSendCancel(cid, 'Sorry, you do not have enough space.')
			else
				for i = 1, tonumber(getItemInfo(v.container).maxItems) do
					doAddContainerItem(bp, v.rune, v.charges)
				end
				doPlayerRemoveMoney(cid, v.cost)
				doSendMagicEffect(getThingPos(cid), v.effect)
				doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, 'You have purchased a backpack of ' .. getItemNameById(v.rune) .. 's.')
			end
		else
			return doPlayerSendCancel(cid, 'Sorry, you must have ' .. v.cost .. ' gold.')
		end
	else
		return doPlayerSendCancel(cid, 'Sorry, you need ' .. math.ceil(weight) .. 'oz. to carry this item.')
	end
	return doTransformItem(item.uid, item.itemid == 1945 and 1946 or 1945)
end
 
Last edited:
it dont work now it gets that error

data/actions/scripts/runes.lua:18 'for' limit must be a number

u dont know why ?
 
Last edited by a moderator:
[20/04/2010 08:10:04] [Error - Action Interface]
[20/04/2010 08:10:04] data/actions/scripts/potion lever.lua:eek:nUse
[20/04/2010 08:10:04] Description:
[20/04/2010 08:10:04] data/actions/scripts/potion lever.lua:14: attempt to index local 'v' (a nil value)
[20/04/2010 08:10:04] stack traceback:
[20/04/2010 08:10:04] data/actions/scripts/potion lever.lua:14: in function <data/actions/scripts/potion lever.lua:12>
 
[20/04/2010 08:10:04] [Error - Action Interface]
[20/04/2010 08:10:04] data/actions/scripts/potion lever.lua:eek:nUse
[20/04/2010 08:10:04] Description:
[20/04/2010 08:10:04] data/actions/scripts/potion lever.lua:14: attempt to index local 'v' (a nil value)
[20/04/2010 08:10:04] stack traceback:
[20/04/2010 08:10:04] data/actions/scripts/potion lever.lua:14: in function <data/actions/scripts/potion lever.lua:12>

Thats cool ?

Post the script you're using
 
Woops, my bad..sorry...

I'm using Cykotitan's Script



Code:
local shop = {
	[1016] = {
		rune = 2268, container = 2003, cost = 5000, charges = 3, effect = CONST_ME_GIFT_WRAPS
	},
	[1015] = {
		rune = 2269, container = 2002, cost = 3000, charges = 3, effect = CONST_ME_GIFT_WRAPS
	}
}
function onUse(cid, item, fromPosition, itemEx, toPosition)
	local v = shop[item.actionid]
	local weight = getItemWeightById(v.rune, tonumber(getItemInfo(v.container).maxItems)) + getItemWeightById(v.container, 1)
	if getPlayerFreeCap(cid) >= weight then
		if getPlayerMoney(cid) >= v.cost then
			local bp = doCreateItemEx(cid, v.container, 1)
			if doPlayerAddItemEx(cid, bp) ~= RETURNVALUE_NOERROR then
				return doPlayerSendCancel(cid, 'Sorry, you do not have enough space.')
			else
				for i = 1, tonumber(getItemInfo(v.container).maxItems) do
					doAddContainerItem(bp, v.rune, v.charges)
				end
				doPlayerRemoveMoney(cid, v.cost)
				doSendMagicEffect(getThingPos(cid), v.effect)
				doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, 'You have purchased a backpack of ' .. getItemNameById(v.rune) .. 's.')
			end
		else
			return doPlayerSendCancel(cid, 'Sorry, you must have ' .. v.cost .. ' gold.')
		end
	else
		return doPlayerSendCancel(cid, 'Sorry, you need ' .. math.ceil(weight) .. 'oz. to carry this item.')
	end
	return doTransformItem(item.uid, item.itemid == 1945 and 1946 or 1945)
end
 
Actually it's JDB's script.

It's because you're not using a correct actionID, according to that script you should either use 1015 or 1016.
 
Back
Top