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

Lua Operating the Extra Loot Storage

I wanna know too, and if it is the right way...
I have a suggestion to you, to use this script i'll use too (idk its all right, if isnt pls tell me, but i think its perfect)

A donate amulet, to you sell on blazera to set your loot +50%
(You loot was 10x, with 15x to players who buy the donate amulet)

Suggestion amulet ID:
11393

Script:
Code:
    <!-- loot amulet -->
   <movevent type="Equip" itemid="11393" slot="backpack" event="script" value="lootamulet.lua" />
   <movevent type="DeEquip" itemid="11393" slot="backpack" event="script" value="lootamulet.lua"/>

lootamulet.lua
Code:
local storage = 123

function onEquip(cid, item, slot)
   if getPlayerStorageValue(cid, storage) < 1 then
        if getPlayerSlotItem(cid, slot).itemid == item.itemid then
          setPlayerStorageValue(cid, storage, 50)
          doPlayerSave(cid)
        end
   end
   return true
end

function onDeEquip(cid, item, slot)
   if getPlayerStorageValue(cid, storage) > 0 then
      setPlayerStorageValue(cid, storage, 1)
      doPlayerSave(cid)
   end
   return true
end
 
I wanna know too, and if it is the right way...
I have a suggestion to you, to use this script i'll use too (idk its all right, if isnt pls tell me, but i think its perfect)

A donate amulet, to you sell on blazera to set your loot +50%
(You loot was 10x, with 15x to players who buy the donate amulet)

Suggestion amulet ID:
11393

Script:
Code:
    <!-- loot amulet -->
   <movevent type="Equip" itemid="11393" slot="backpack" event="script" value="lootamulet.lua" />
   <movevent type="DeEquip" itemid="11393" slot="backpack" event="script" value="lootamulet.lua"/>

lootamulet.lua
Code:
local storage = 123

function onEquip(cid, item, slot)
   if getPlayerStorageValue(cid, storage) < 1 then
        if getPlayerSlotItem(cid, slot).itemid == item.itemid then
          setPlayerStorageValue(cid, storage, 50)
          doPlayerSave(cid)
        end
   end
   return true
end

function onDeEquip(cid, item, slot)
   if getPlayerStorageValue(cid, storage) > 0 then
      setPlayerStorageValue(cid, storage, 1)
      doPlayerSave(cid)
   end
   return true
end
you need return callFunction(cid, item.uid, slot) in both functions or else the item's attributes wont be added to the player
 
Havent gotten around to testing yet, but just wanted to ask - we have a storage for extraloot = 123.

If I set a player to doPlayerSetStorage(cid, 123, 50) would that increase his find chance by 50%?

Script: https://otland.net/threads/mod-random-item-stats.130295/

Thanks for the help :D

You will have to do 100+, while 100 is 100% everything above would mean extra loot chance.
You could test that by setting the storage to 0 you will notice there wont drop any loot
 
Back
Top