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

Vocation chest script

fire_shock666

New Member
Joined
Jun 3, 2014
Messages
24
Reaction score
0
Location
Netherlands
Hey there,

i need a script for 1 chest for each vocation,
so voc 1 get item
voc 2 get another items and so on.
it also need StorageValue

who can help me with this?
i use cryingdamson 0.3.6 (8.60) V8.2

tnx for your time
 
Which vocations? Should not promoted and promoted vocations get a different reward?
Can you add a list of which voc should get which item? Should they get a different storage value or the same?
 
all non-promoted and promoted get the same item
Voc 1 7891 Magma Boots
voc 2 11113 crystal boots
voc 3 2645 steel boots
voc 4 2646 Golden boots
and can they get same starage value?
 
Code:
local items = {
   [{1, 5}] = 7891,
   [{2, 6}] = 11113,
   [{3, 7}] = 2645,
   [{4, 8}] = 2646
}

local storage = 83743

function onUse(cid, item, fromPosition, itemEx, toPosition)

     for voc, itemid in pairs(items) do
         if isInArray(voc, getPlayerVocation(cid)) then
             if getPlayerStorageValue(cid, storage) == -1 then
                 doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You received "..getItemInfo(itemid).name..".")
                 doPlayerAddItem(cid, itemid, 1)
                 setPlayerStorageValue(cid, storage, 1)
             else
                 doPlayerSendTextMessage(cid, MESSAGE_EVENT_ADVANCE, "It is empty.")
                 doSendMagicEffect(getThingPos(cid), CONST_ME_POFF)
             end
             return true
         end
     end
     return true
end
 
Back
Top