• 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!
  • New resources must be posted under Resources tab. A discussion thread will be created automatically, you can't open threads manually anymore.

TalkAction Aol Script :)

life4me

Don't dream it, be it.
Joined
Jun 27, 2009
Messages
928
Reaction score
16
Location
Otland
Hello!

Here is an aol script i did on my own!.


~~Aol Script~~


Go to data/talkactions/scripts and create a file called aol.lua
PHP:
function onSay(cid, words, param)
if doPlayerRemoveMoney(cid, 10000) == TRUE then
doPlayerAddItem(cid, 2173, 1)
doSendMagicEffect(getPlayerPosition(cid), CONST_ME_MORTAREA)
doCreatureSay(cid, "!aol", TALKTYPE_ORANGE_1)
else
doPlayerSendCancel(cid, 'You don\'t have enough money.')
doSendMagicEffect(getPlayerPosition(cid), CONST_ME_FLAMEAREA)
end
end


Now go to data/talkactions/talkactions.xml
PHP:
<talkaction words="!aol"script="aol.lua"/>


Dont forgett to Rep++ :thumbup:
 
Last edited:
Lua:
local items =
{
    ["aol"] = {id = 2173, count = 1, cost = 10000},
    ["shovel"] = {id = 2554, count = 1, cost = 50}
}

function onSay(cid, words, param)
local buyItem = items[param]
    if buyItem ~= nil then
	if doPlayerRemoveMoney(cid, buyItem.cost) == TRUE then
		doPlayerAddItem(cid, buyItem.id,buyItem.count)
		doSendMagicEffect(getPlayerPosition(cid), CONST_ME_MORTAREA)
		doCreatureSay(cid, ".. getItemNameById(buyItem.id) ..", TALKTYPE_ORANGE_1)
	else
		doPlayerSendCancel(cid, "You don\'t have enough money.")
		doSendMagicEffect(getPlayerPosition(cid), CONST_ME_FLAMEAREA)
    else
	doPlayerSendCancel(cid, "Invaild item name.")
	end
    end
    return TRUE
end
 
Back
Top