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

shop lever without backpack

president vankk

Web Developer & AuraOT Owner
Joined
Jul 10, 2009
Messages
5,719
Solutions
9
Reaction score
339
I wanted a script that you use when you purchase one from sudden death rune with 25x and so on ...
 
Code:
local shop = {
	[1000] = {
		rune = 2268, cost = 5000, charges = 3, effect = CONST_ME_GIFT_WRAPS
	},
	[1001] = {
		rune = 2273, cost = 3000, charges = 3, effect = CONST_ME_GIFT_WRAPS
	}
}
function onUse(cid, item, fromPosition, itemEx, toPosition)
	local v = shop[item.actionid]
	if getPlayerMoney(cid) < v.cost then
		doPlayerSendCancel(cid, "You need " .. v.cost .. " gold to buy this item.")
	elseif getPlayerFreeCap(cid) < getItemInfo(v.rune).weight then
		doPlayerSendCancel(cid, "You need " .. string.format("%.2f", getItemInfo(v.rune).weight) .. " oz. to take this item.")
	else
		local k = doCreateItemEx(v.rune, v.charges)
		if doPlayerAddItemEx(cid, k) ~= RETURNVALUE_NOERROR then
			doPlayerSendCancel(cid, "You don't have enough space.")
		else
			doPlayerRemoveMoney(cid, v.cost)
			doSendMagicEffect(getThingPos(cid), v.effect)
			doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You have purchased a backpack of " .. getItemInfo(v.rune).plural .. ".")
			doTransformItem(item.uid, item.itemid == 1945 and 1946 or 1945)
		end
	end
	return true
end
 
Code:
function onUse(cid, item, frompos, item2, topos)
local cost = 3400
local charges = 25
if doPlayerRemoveMoney(cid, cost) == TRUE then
doPlayerAddItem(cid, 2268, charges)
 doPlayerSendTextMessage(cid,22,"You have bought SD.")
 else
 doPlayerSendTextMessage(cid,22,"You don/'t have engouh money.")
end
end
 
Last edited:
neither do work for you, ok. you gotta use do an while external skrypt* get while accidentally the whole skrypts so what do??????????
WTF? I tested it on a simple war ot and they aint worked for me..
 
Lua:
function onUse(cid, item, frompos, item2, topos)
local cost = 3400
local charges = 25
if doPlayerRemoveMoney(cid, cost) == TRUE then
doPlayerAddItem(cid, 2268, charges)
 doPlayerSendTextMessage(cid,22,"You have bought SD.")
 else
 doPlayerSendTextMessage(cid,22,"You don/'t have engouh money.")
end
end
[Tested on TFS 0.3.6]
Next time copy errors from console...
 
Back
Top