Marcus
User.postCount++;
This command will allow players to refill their soft boots for a price.
either by money, or by an item, or both.
If you want to use the script for other boots, like firewalker or something, you can easy change the ids "wornboots" and "newboots".
Hope you enjoy it!
talkactions.xml
softboots.lua
either by money, or by an item, or both.
If you want to use the script for other boots, like firewalker or something, you can easy change the ids "wornboots" and "newboots".
Hope you enjoy it!
talkactions.xml
PHP:
<talkaction words="!softboots" script="softboots.lua" />
softboots.lua
PHP:
local config = {
--Item Ids
["wornboots"] = 6530,
["newboots"] = 6132,
--Price
--Notice:
--If you just want it to cost money, leave itemid and itemamount as "nil".
--If you only want it to cost an item, give the item id and the amount you want it to cost and leave "price" as nil.
--If you want to use both, leave nothing as nil.
["price"] = 10000,
["price_itemId"] = nil,
["price_itemAmount"] = nil,
--Messages
["message_refilled"] = "You have refilled your soft boots!",
["message_NotEnoughMoney"] = "Refill soft boots costs 10,000 gold!",
["message_NoHaveItem"] = "You do not have ITEMNAME!",
["message_NoWornBoots"] = "You do not have any worn soft boots!"
}
function onSay(cid, words, param)
if getPlayerItemCount(cid, config["wornboots"]) < 1 then
doCreatureSay(cid, config["message_NoWornBoots"], TALKTYPE_ORANGE_1)
end
if config["price"] and player:getMoney() < config["price"] then
doCreatureSay(cid, config["message_NotEnoughMoney"], TALKTYPE_ORANGE_1)
return false
end
if config["price_itemId"] and config["price_itemAmount"] and getPlayerItemCount(cid, config["price_itemId"]) < config["price_itemAmount"] then
doCreatureSay(cid, config["message_NoHaveItem"], TALKTYPE_ORANGE_1)
return false
end
if config["price"] then
doPlayerRemoveMoney(cid, config["price"])
end
if config["price_itemId"] and config["price_itemAmount"] then
doPlayerRemoveItem(cid, config["price_itemId"], config["price_itemAmount"])
end
doPlayerRemoveItem(cid, config["wornboots"], 1)
doPlayerAddItem(cid, config["newboots"], 1)
doCreatureSay(cid, config["message_refilled"], TALKTYPE_ORANGE_1)
return true
end
Last edited: