• 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!
  • 2026 staff recruitment is open! Check it out and consider applying!

[TFS 1.0]Script talkaction !Flask

samuelav3

Member
Joined
Aug 18, 2014
Messages
95
Reaction score
5
anyone can help me with this script
you say
! flask and the emply pots disappear and you earn money
 
Code:
local vials = {
     {id = 7636, gold = 5},
     {id = 7634, gold = 10},
     {id = 7635, gold = 15}
}

function onSay(cid, words, param)

     local player, n = Player(cid), 0
     for v = 1, #vials do
         local count = player:getItemCount(vials[v].id)
         if count >= 1 then
             player:removeItem(vials[v].id, count)
             player:addMoney(count * vials[v].gold)
             n = n + count * vials[v].gold
         end
     end
     if n > 1 then
         text, effect = "You earned "..n.." gold by selling flasks.", CONST_ME_GIFT_WRAPS
     else
         text, effect = "You don't have flasks to sell.", CONST_ME_POFF
     end
     player:sendTextMessage(MESSAGE_INFO_DESCR, text)
     player:getPosition():sendMagicEffect(effect)
     return true
end
 
Back
Top