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

help, change in script

adrianokk

New Member
Joined
Jan 22, 2019
Messages
43
Reaction score
1
How do I add the amount of items that the player got in this scrip?
I was able to put the name of the item it collects, but I could not put the amount


Lua:
           doSendAnimatedText(topos, ""..random.."", TEXTCOLOR_RED)
           addEvent(doPlayerSendTextMessage, 3*950, cid, 20, "Voce coletou "..getItemNameById(fruit)..".")
       else
           doSendAnimatedText(topos, ""..random.."", TEXTCOLOR_RED)
           addEvent(doPlayerSendTextMessage, 4*950, cid, 20,  "Voce nao conseguiu coletar.")
       end
   end
   return true
end
 
Last edited:
doPlayerRemoveItem(cid, itemid, count, <optional> subtype, <optional> ignoreEquipped)


You want an item to get removed right?
 
No, this scrip is for the player to collect items.
I want when the player picks up the item, the amount of items that he has collected will appear inside the message
 
Not sure what version of TFS you are using so one of these:
Code:
item:getCount()
- or -
Code:
item.type
Unless you post the rest of the code, this is the best we can suggest.
 
TFS 0,3
Lua:
   local cogumelo = mushroom[itemEx.itemid]
   if cogumelo then
       local random = texts[math.random(1,#texts)]
       if math.random(1,100) >= chance2 then
           addEvent(doPlayerAddItem, 3*1000, cid, cogumelo, math.random (1, 8))
             local old_id, old_pos = itemEx.itemid, getThingPos(itemEx.uid)
             doTransformItem(itemEx.uid, ItemQuebrado2)
             addEvent(function()
               local stump = getTileItemById(old_pos, ItemQuebrado2)
               if stump.uid then
                   doTransformItem(stump.uid, old_id)
               end
             end, time * 60000)
             doSendAnimatedText(topos, ""..random.."", TEXTCOLOR_RED)
             addEvent(doPlayerSendTextMessage, 3*950, cid, 20, "Voce coletou alguns Cogumelos.")
            else
           doSendAnimatedText(topos, ""..random.."", TEXTCOLOR_RED)
           addEvent(doPlayerSendTextMessage, 4*950, cid, 20,  "Voce nao conseguiu coletar.")
         end
       return true
     end
 
Lua:
   local cogumelo = mushroom[itemEx.itemid]

   if cogumelo then

       local random = texts[math.random(1,#texts)]

       if math.random(1,100) >= chance2 then

           addEvent(doPlayerAddItem, 3*1000, cid, cogumelo, math.random (1, 8))

             local old_id, old_pos = itemEx.itemid, getThingPos(itemEx.uid)

             doTransformItem(itemEx.uid, ItemQuebrado2)

             addEvent(function()

               local stump = getTileItemById(old_pos, ItemQuebrado2)

               if stump.uid then

                   doTransformItem(stump.uid, old_id)

               end

             end, time * 60000)

             doSendAnimatedText(topos, ""..random.."", TEXTCOLOR_RED)

             addEvent(doPlayerSendTextMessage, 3*950, cid, 20, "Voce coletou "..random.." Cogumelos.")

            else

           doSendAnimatedText(topos, ""..random.."", TEXTCOLOR_RED)

           addEvent(doPlayerSendTextMessage, 4*950, cid, 20,  "Voce nao conseguiu coletar.")

         end

       return true

     end

lol what happened

is just that?
 
It would be like this ..
x = quantity that was collected -->> ( I need to put the amount that was collected )<<
item name = ..getItemNameById(fruit)..

Lua:
             doSendAnimatedText(topos, ""..random.."", TEXTCOLOR_RED)

             addEvent(doPlayerSendTextMessage, 3*950, cid, 20, "Voce coletou " (x) ""..getItemNameById(fruit).." Cogumelos.")
 
Last edited:
Back
Top