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

Lua Help on this script plx!

RaikND

facebook.xenoria.org
Joined
May 12, 2010
Messages
942
Reaction score
10
Location
Spain
as I can do to make this script more than one function?
Lua:
local t = {
	container = 5926,
	itemid = 2268,
	subType = 3,
	price = 7500
}
function onUse(cid, item, fromPosition, itemEx, toPosition)
	if(getPlayerMoney(cid) >= t.price) then
		local container = doCreateItemEx(t.container, 1)
		for i = 1, getContainerCap(container) do
			doAddContainerItem(container, t.itemid, t.subType)
		end
		if(doPlayerAddItemEx(cid, container, false) == RETURNVALUE_NOERROR) then
			doPlayerRemoveMoney(cid, t.price)
			doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Bought " .. getContainerCap(container) .. "x " .. getItemDescriptionsById(t.itemid).plural .." for " .. price .." gold.")
		else
			doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You don't have enough " .. (getPlayerFreeCap(cid) < getItemWeight(container, true) and "capacity." or "free space."))
		end
	else
		doPlayerSendCancel(cid, "You don't have enough money.")
	end
	return true
end

i reppe who helps in this theard =)
 
Lol, after buying the "backpack with runes" dont give the "x" charges on each rune, give all charges in one rune :S
 
Last edited:
Back
Top