• 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!
  • 2026 staff recruitment is open! Check it out and consider applying!

Click Lever Buy BP [?]

Dylanaw

Godly Member
Joined
Feb 18, 2009
Messages
473
Reaction score
10
Hi there,
I got a question, can anoyone help me to find a working script for lever that buys a bp >FULL< with [?]

I tried many of them that i found on the forum. but noone is working..

I got TFS 8.6 V3

Could u also change the lever id to : unused 9825 , used 9826? <-- i might messed it up..
The Potions will i change by meself.


Thanks for helping.:$
 
PHP:
	<action actionid="9789" event="script" value="items/green.lua"/>

PHP:
function onUse(cid, item, frompos, item2, topos)
 
	if doPlayerRemoveMoney(cid, 50) then
        doPlayerAddItem(cid, 1988, 1)
        doPlayerSendTextMessage(cid,25,"You bought a Backpack for 50 gold")
	else
        doPlayerSendCancel(cid, "You do not have enough money!")
	end
end

Take this script (which uses a lever to buy a backpack) and have a more advanced-scripter make it so the backpack is full- the script works for me but I only use it for a empty backpack :P
Hopefully this somewhat helps. (I also use TFS 8.6 V3)
 
PHP:
	<action actionid="9789" event="script" value="items/green.lua"/>

PHP:
function onUse(cid, item, frompos, item2, topos)
 
	if doPlayerRemoveMoney(cid, 50) then
        doPlayerAddItem(cid, 1988, 1)
        doPlayerSendTextMessage(cid,25,"You bought a Backpack for 50 gold")
	else
        doPlayerSendCancel(cid, "You do not have enough money!")
	end
end

Take this script (which uses a lever to buy a backpack) and have a more advanced-scripter make it so the backpack is full- the script works for me but I only use it for a empty backpack :P
Hopefully this somewhat helps. (I also use TFS 8.6 V3)


Thank u for sharing it with me.

Does anyone else have a clue how to change gilbert123 script to a working script that buys a backpack full with [..] by clicking the lever?


Thanks in Advance!
 
Here you are:
LUA:
function onUse(cid, item, fromPosition, itemEx, toPosition)
	local config = {
		money = 50, -- How much it will cost (in GPs)
		bp = 1988, -- ID of backpack
		item = {2268, 3, 20} -- {ID of item (now is SD rune), Amount of selling item (now SD will have 3 charges), Amount of selling item (now in BP will be 20x of SD)}
		}
		
	if doPlayerRemoveMoney(cid, config.money) then 
		local bp = doPlayerAddItem(cid, config.bp, 1)
		for i = 1, config.item[3] do
			doAddContainerItem(bp, config.item[1], config.item[2])
		end
		doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You have bought backpack with " .. config.item[3] .. "x of " .. getItemNameById(config.item[1]) .. " (" .. config.item[2] .. " charge each) for " .. config.money .. " gold coins.") 
	else 
		return doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You don't have enought gold coins.")
	end
	return true
end
 
Back
Top