peteralto
Member
- Joined
- Nov 1, 2020
- Messages
- 93
- Solutions
- 1
- Reaction score
- 17
I have a task system, and in it there is the reward of a fixed item and a random item, which are declared in a lib.
Would it be possible for these two rewards, the fixed and the random one, to be delivered inside a bag in the players depot?
Would it be possible for these two rewards, the fixed and the random one, to be delivered inside a bag in the players depot?
Lua:
if msgcontains(msg, "report") then
if player:getStorageValue(DT_STORAGES.HAVE_STARTED) == 1 then
if player:getStorageValue(DT_STORAGES.EASY) >= DT_NEEDKILL_EASY then
npcHandler:say("Just in time! Here are your rewards, come back tomorrow for another task!", cid)
player:setStorageValue(DT_STORAGES.HAVE_STARTED, -2)
player:addItem(DT_PREMIOFIXO_ID_EASY, DT_PREMIOFIXO_QTDE_EASY) --fixed
if DT_PREMIOQTDE_EASY > 0 then --random
if DT_PREMIOQTDE_EASY == 1 then -- random
aa = math.random(#DT_PRIZEID_EASY)
player:addItem(DT_PRIZEID_EASY[aa], 1)
else
for i = 1, tonumber(DT_PREMIOQTDE_EASY) do
aa = math.random(#DT_PRIZEID_EASY)
player:addItem(DT_PRIZEID_EASY[aa], 1)
end
end
end
else
npcHandler:say("You haven't finished your task yet. You still have to kill {"..DT_NEEDKILL_EASY - player:getStorageValue(DT_STORAGES.EASY) .."} "..DT_CHOSENTASK_EASY.."(s).", cid)
end