Sir Shutter
Learning LUA
hey guys on my server im using tfs 0.3 , the aol doesnt work
when i die i dont lose the aol and my bp falls down
also when i say !buy "aol it says invalid item and the script is fine
here is the script for !buy "aol
plz help i give rep
when i die i dont lose the aol and my bp falls down
also when i say !buy "aol it says invalid item and the script is fine
here is the script for !buy "aol
Code:
-----------------------By Nahruto--------------------------
-------------------http://otfans.net/----------------------
function getPlayerMoney(cid)
gold = getPlayerItemCount(cid,2148)
plat = getPlayerItemCount(cid,2152)*100
crys = getPlayerItemCount(cid,2160)*10000
money = gold + plat + crys
return money
end
local items = {
["aol"] = {cash=10000, id=2173, amount=1},
["food"] = {cash=2000, id=2671, amount=100},
["backpack"] = {cash=100, id=1988, amount=1}
}
---------End Config ---------
function onSay(cid, words, param)
bitem = items[param]
if (bitem ~= nil) then
if getPlayerMoney(cid) >= bitem.cash then
doPlayerAddItem(cid,bitem.id,bitem.amount)
doPlayerRemoveMoney(cid,bitem.cash)
else
doPlayerSendCancel(cid,"Sorry, you dont have enough money")
end
else
doPlayerSendCancel(cid, "Invalid item.")
end
return 1
end
plz help i give rep