function onUse(cid, item, fromPosition, itemEx, toPosition)
if getPlayerStorageValue(cid, 9002) == -1 then
setPlayerStorageValue(cid, 9002, 1)
local bp1 = doPlayerAddItem(cid, 1991, 1)
doAddContainerItem(bp1, 2168, 2)
doAddContainerItem(bp1, 2214, 2)
doAddContainerItem(bp1, 2197, 2)
doAddContainerItem(bp1, 2167, 2)
end
doPlayerSendTextMessage(cid, 24, "You found a bag of supplies.")
end
return TRUE
end
end
function onUse(cid, item, fromPosition, itemEx, toPosition)
if getPlayerStorageValue(cid, 9002) == -1 then
setPlayerStorageValue(cid, 9002, 1)
local bp1 = doPlayerAddItem(cid, 1991, 1)
doAddContainerItem(bp1, 2168, 2)
doAddContainerItem(bp1, 2214, 2)
doAddContainerItem(bp1, 2197, 2)
doAddContainerItem(bp1, 2167, 2)
end
doPlayerSendTextMessage(cid, 24, "You found a bag of supplies.")
end
return TRUE
end
function onUse(cid, item, fromPosition, itemEx, toPosition)
if getPlayerStorageValue(cid, 9002) == -1 then
setPlayerStorageValue(cid, 9002, 1)
local bp1 = doPlayerAddItem(cid, 1991, 1)
doAddContainerItem(bp1, 2168, 2)
doAddContainerItem(bp1, 2214, 2)
doAddContainerItem(bp1, 2197, 2)
doAddContainerItem(bp1, 2167, 2)
doPlayerSendTextMessage(cid, 24, "You found a bag of supplies.")
end
return TRUE
end
Function...
If...
Else...
End..
Return...
End..
function onUse(cid, item, fromPosition, itemEx, toPosition)
if getPlayerStorageValue(cid, 9002) == -1 then
setPlayerStorageValue(cid, 9002, 1)
local bp1 = doPlayerAddItem(cid, 1991, 1)
doAddContainerItem(bp1, 2168, 2)
doAddContainerItem(bp1, 2214, 2)
doAddContainerItem(bp1, 2197, 2)
doAddContainerItem(bp1, 2167, 2)
doPlayerSendTextMessage(cid, 24, "You found a bag of supplies.")
end
return TRUE
end
function onUse(cid, item, fromPosition, itemEx, toPosition)
if getPlayerStorageValue(cid, 9002) == -1 then
setPlayerStorageValue(cid, 9002, 1)
local bp1 = doPlayerAddItem(cid, 1991, 1)
doAddContainerItem(bp1, 2168, 2)
doAddContainerItem(bp1, 2214, 2)
doAddContainerItem(bp1, 2197, 2)
doAddContainerItem(bp1, 2167, 2)
end
doPlayerSendTextMessage(cid, 24, "You found a bag of supplies.")
return TRUE
end
local items = {
2168,
2214,
2197,
2167
}
function onUse(cid, item, fromPosition, itemEx, toPosition)
if getPlayerStorageValue(cid, 9002) == -1 then
setPlayerStorageValue(cid, 9002, 1)
local bp1 = doPlayerAddItem(cid, 1991, 1)
for i = 0, #items do
doAddContainerItem(bp1, items[i], 2)
end
end
doPlayerSendTextMessage(cid, 24, "You found a bag of supplies.")
return TRUE
end
function onUse(cid, item, fromPosition, itemEx, toPosition)
if getPlayerStorageValue(cid, 9002) == -1 then --If storage is right...
setPlayerStorageValue(cid, 9002, 1) -- This will do
local bp1 = doPlayerAddItem(cid, 1991, 1)
doAddContainerItem(bp1, 2168, 2)
doAddContainerItem(bp1, 2214, 2)
doAddContainerItem(bp1, 2197, 2)
doAddContainerItem(bp1, 2167, 2)
doPlayerSendTextMessage(cid, 24, "You found a bag of supplies.")
else -- If storage is used...
doPlayerSendtextMessage(cid, 22, "You already received a bag of supplies.")
end
return TRUE
end
Function... --Start function
If... --Start condition
Else... --If condition is false or 0 or nil respecting the code...
--Condition when condition If is false or wrong
End... --This close the IF
Return... --Return to the main
End... --Closes the funcion
Lua:function onUse(cid, item, fromPosition, itemEx, toPosition) if getPlayerStorageValue(cid, 9002) == -1 then --If storage is right... setPlayerStorageValue(cid, 9002, 1) -- This will do local bp1 = doPlayerAddItem(cid, 1991, 1) doAddContainerItem(bp1, 2168, 2) doAddContainerItem(bp1, 2214, 2) doAddContainerItem(bp1, 2197, 2) doAddContainerItem(bp1, 2167, 2) doPlayerSendTextMessage(cid, 24, "You found a bag of supplies.") else -- If storage is used... doPlayerSendtextMessage(cid, 22, "You already received a bag of supplies.") end return TRUE end
function onUse(cid, item, fromPosition, itemEx, toPosition)
if getPlayerStorageValue(cid, 9002) == -1 then --If storage is right...
setPlayerStorageValue(cid, 9002, 1) -- This will do
local bp1 = doPlayerAddItem(cid, 1991, 1)
doAddContainerItem(bp1, 2168, 2)
doAddContainerItem(bp1, 2214, 2)
doAddContainerItem(bp1, 2197, 2)
doAddContainerItem(bp1, 2167, 2)
doPlayerSendTextMessage(cid, 24, "You found a bag of supplies.")
else -- If storage is used...
doPlayerSendtextMessage(cid, 22, "You already received a bag of supplies.")
end
return TRUE
end
function onUse(cid, item, fromPosition, itemEx, toPosition)
if getPlayerStorageValue(cid, 9002) == -1 then
setPlayerStorageValue(cid, 9002, 1)
local bp1 = doPlayerAddItem(cid, 1991, 1)
doAddContainerItem(bp1, 2168, 1)
doAddContainerItem(bp1, 2214, 1)
doAddContainerItem(bp1, 2197, 1)
doAddContainerItem(bp1, 2167, 1)
doAddContainerItem(bp1, 2168, 1)
doAddContainerItem(bp1, 2214, 1)
doAddContainerItem(bp1, 2197, 1)
doAddContainerItem(bp1, 2167, 1)
doPlayerSendTextMessage(cid, 24, "You found a bag of supplies.")
else -- If storage is used...
doPlayerSendtextMessage(cid, 22, "You already received a bag of supplies.")
end
return TRUE
end
function onUse(cid, item, fromPosition, itemEx, toPosition)
if getPlayerStorageValue(cid, 9002) == -1 then
setPlayerStorageValue(cid, 9002, 1)
local bp1 = doPlayerAddItem(cid, 1991, 1)
doAddContainerItem(bp1, 2168, 2)
doAddContainerItem(bp1, 2214, 2)
doAddContainerItem(bp1, 2197, 2)
doAddContainerItem(bp1, 2167, 2)
doPlayerSendTextMessage(cid, 24, "You found a bag of supplies.")
else
doPlayerSendCancel(cid, 'This chest is empty.')
end
return TRUE
end
local items = {
2168,
2214,
2197,
2167,
2168,
2214,
2197,
2167
}
function onUse(cid, item, fromPosition, itemEx, toPosition)
if getPlayerStorageValue(cid, 9002) == -1 then
setPlayerStorageValue(cid, 9002, 1)
local bp1 = doPlayerAddItem(cid, 1991, 1)
for i = 0, #items do
doAddContainerItem(bp1, items[i], 2)
end
doPlayerSendTextMessage(cid, 24, "You found a bag of supplies.")
else
doPlayerSendCancel(cid, 'This chest is empty.')
end
return TRUE
end
function onUse(cid, item, fromPosition, itemEx, toPosition)
if getPlayerStorageValue(cid, 9002) == -1 then --If storage is right...
setPlayerStorageValue(cid, 9002, 1) -- This will do
local bp1 = doPlayerAddItem(cid, 1991, 1)
doAddContainerItem(bp1, 2168, 2)
doAddContainerItem(bp1, 2214, 2)
doAddContainerItem(bp1, 2197, 2)
doAddContainerItem(bp1, 2167, 2)
doPlayerSendTextMessage(cid, 24, "You found a bag of supplies.")
else -- If storage is used...
doPlayerSendtextMessage(cid, 22, "You already received a bag of supplies.")
end
return TRUE
end