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

TalkAction !softboots - refill soft boots TFS 1.1 (pay with money, item or both))

Marcus

User.postCount++;
Joined
Nov 14, 2015
Messages
1,074
Solutions
10
Reaction score
392
Location
Sweden
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
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:
It works... but it has worn soft boots item id 6530, and in my server worn soft boots is item id 10021, when I change 6530 for 10021 in softboots.lua it doesnt work when I reload talkactions by command, fix that.
 
It works... but it has worn soft boots item id 6530, and in my server worn soft boots is item id 10021, when I change 6530 for 10021 in softboots.lua it doesnt work when I reload talkactions by command, fix that.

you changed
Lua:
 ["wornboots"] = 6530,
to?
Lua:
 ["wornboots"] = 10021,
in the talkaction script
 
Yes I did that, but the command doesnt work in tibia when I change it.

try with replacing this...
instead of the local config tables use
Lua:
local item = 6530
local cost = 5000 --- money price

instead of using getPlayerItemCount and doCreatureSay use, as example
Lua:
if item < 1 then
player:say("You do not have any worn soft boots!", TALKTYPE_MONSTER_SAY)
end
and instead of doPlayerRemoveItem and doPlayerAddItem use this and remember to set local item same as item from item:remove...
Lua:
player:addItem(6132, 1)
item:remove()
player:removeMoney(cost)
else
player:sendTextMessage(MESSAGE_INFO_DESCR, "You don't have enough money.")

use this and adapt to the script to get it work, hope this helps you!
 
Last edited:
Back
Top