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

TalkAction Easy Donator BuyItem!

Jesper_Kladden

Donator
Joined
May 16, 2008
Messages
458
Reaction score
1
Location
Sweden
PHP:
<talkaction words="!buy" script="DonatorBuying.lua" />

That's what should be in Talkactions.xml ^

This one should be called "DonatorBuying.lua" V

PHP:
--[[

This script is made by Jesper_Kladden @ Tpforums, TibiaTek, Otf4ns or Otland.

Use this script only if you have experience in other scripts.

Thanks to Master-M, Evil Hero, and Colandus for helping.

]]--

-- Configuration --

local DonationValue = 666 -- The special storage value a Donator has (Can't be higher than 65.000(65k)).
local AOL = 2173 -- Amulet of loss
local BPH = 2365 -- BackPack of holding
local BOH = 2195 -- Boots of haste
local SBOOTS = 2640 -- Soft Boots
local AOLP = 20000 -- Price of AOL
local BPHP = 100000 -- Price of Backpack of holding
local BOHP = 50000 -- Price of BOH
local SBOOTSP = 1000000 -- Price of Soft Boots

-- End Configuration --

function onSay(cid, word, param)

setPlayerStorageValue(cid, DonationValue, 1) --<- I used this for testing if it works. Delete if you don't want to test

   if getPlayerStorageValue(cid, DonationValue) == 1 then
   
		if param == "aol" and doPlayerRemoveMoney(cid, AOLP) == TRUE then
			doPlayerAddItem(cid, AOL, 1)
			
		elseif param == "boh" and doPlayerRemoveMoney(cid, BOHP) == TRUE then
			doPlayerAddItem(cid, BOH, 1)
			
		elseif param == "bpholding" and doPlayerRemoveMoney(cid, BPHP) == TRUE then
			doPlayerAddItem(cid, BPH, 1)	
			
		elseif param == "softboots" and doPlayerRemoveMoney(cid, SBOOTSP) == TRUE then
			doPlayerAddItem(cid, SBOOTS, 1)
			
		elseif param == "prices" then
			doPlayerSendTextMessage(cid, 22,
			"Prices for Donation-Fast-Buyment:\n--------\n Boots of haste(boh) - 50k\n Amulet of loss(aol) - 20k\n Backpack of holding (bpholding) - 100k\n Soft Boots (softboots) - 1kk(1000k)\n--------\n Script created by 'Jesper_Kladden'")
			
		else
		
			doPlayerSendTextMessage(cid, 22, "Either you're not a donator or you don't have enough cash!!")
		end
	end
end


The script works like this:

*You must be a donator and have a certain storagevalue
*You can write either - !buy "aol/boh/softboots/bpholding
*If you can't afford, the script will tell you that
*If you're not a donator, the script will tell you that.
 
Last edited by a moderator:
Kinda a easy script, but you're getting better, and it looks nice ;)
 
isn't it function onSay(cid, words, param) and not onSay(cid, word, param)?
 
I donno, I just copy/pasted it from my other script and it worked so:p

OK, you're officially nab now.. kthxbye :D (your other script has words)

Code:
-- Starting the function --
function onSay ( cid, words, param )
	
	--Start configuration --

	-- Items you can buy --
	items =
 
Back
Top