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

Aol problem

talkactions/scripts/aol.lua

LUA:
function onSay(cid, words, param)	
 
if doPlayerRemoveMoney(cid, 10000) then
			doPlayerAddItem(cid, 2173, 1)
				doPlayerSendTextMessade(cid, MESSAGE_INFO_DESCR, "You have bought an amulet of loss for 1 cc!")
				doSendMagicEffect(getCreaturePosition(cid), CONST_ME_FIREWORK_RED)
			else
				doPlayerSendCancel(cid, "Sorry, You need 1 cc to buy a aol.")
				doSendMagicEffect(getCreaturePosition(cid), CONST_ME_POFF)
			end
	return true
end

talkactions.xml

XML:
<talkaction words="!aol" event="script" value="aol.lua"/>

Explanation: Player use command !aol and he buy aol for 1 cc.


Credits to Clinten and edit by me!
 
Works? :P

LUA:
<?xml version="1.0" encoding="UTF-8"?>
<mod name="command-buy" version="1.0" author="slawkens" contact="[email protected]" enabled="yes">
	<config name="command-buy-config"><![CDATA[
		items = {
			['aol'] =		{cost = 30000,	id = 2173},
		}
	]]></config>

	<talkaction words="!buy" event="script"><![CDATA[
		domodlib('command-buy-config')
		local config = {
			items = items
		}

		function onSay(cid, words, param, channel)
			if(param == '') then
				local str = ""
				for name, options in pairs(config.items) do
					str = str .. "\n" .. name
				end

				doPlayerPopupFYI(cid, "!buy\n\n:" .. str)
				return true
			end

			local item = config.items[param]
			if(item ~= nil) then
				if(not doPlayerRemoveMoney(cid, item.cost)) then
					doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Not enough money to buy " .. param .. ".\n(" .. item.cost .. "gp)")
					return true
				end

				local amount = item.amount and item.amount or 1
				doPlayerAddItem(cid, item.id, amount)
				doSendMagicEffect(getCreaturePosition(cid), CONST_ME_GIFT_WRAPS)
			else
				doPlayerSendCancel(cid, "Item not found. Use '!buy' to see the list.")
			end

			return true
		end
	]]></talkaction>
</mod>

Just put this in your Mods folder :)
The command is !buy aol

Some more usefull things
http://code.google.com/p/tfs-mods/wiki/Mods
 
did u guys even read?
he doesnt need an 'buy aol script' the players from his server dont lose aol.
@OP
did u gave the aol with a god character?
 
Well, as bogart said, if you gave a aol from the GM, it will count as 100 aols, so just buy a normal one and check if it works
 
Back
Top