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

What's wrong with this script?

kalle303

New Member
Joined
Oct 13, 2007
Messages
108
Reaction score
4
Location
Sweden
Hello!
I wonder what is wrong with this script?

If you have 5cc: It takes cash but dont give the aol and send "You have not enough gold."
PHP:
local cost = 50000 -- How much does it cost?
local item = 2173 -- What item do you get?
local quantity = 1 -- How many do you get?
 
function onSay(cid, words, param)
    if doPlayerRemoveMoney(cid, cost) == 1 then
        doPlayerAddItem(cid, item, quantity)
    else
        doPlayerSendCancel(cid, "You have not enough gold.")
    end
    return 1
end
Thanks for the help!
/Kalle303
 
try this one instead, works for me tfs 0.3.1

data/talkactions/scripts/aol.lua

Lua:
function onSay(cid, words, param)
if doPlayerRemoveMoney(cid, 50000) == 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_POFF)
		end
	return TRUE
end

data/talkactions/talkactions.xml

Lua:
    <talkaction words="!aol" script="aol.lua" />
 
Back
Top