Macgregor
Executive director
Ah! Nice tutorial
Definitely rep++
Definitely rep++

function onUse(cid, item, fromPosition, itemEx, toPosition)
local container = 0
local cost = 20000
local potion_id = 2273
local backpack_id = 2000
if item.uid == 10203 and item.itemid == 1740 then
container = doPlayerAddItem(cid, backpack_id, 1)
for i = 1, 20 do
doAddContainerItem(container, potion_id, 2268, 2294)
end
return TRUE
end
i think i still doesnt know where to put "end" and "return"
whats wrong with this script?
i get a "end" errorCode:function onUse(cid, item, fromPosition, itemEx, toPosition) local container = 0 local cost = 20000 local potion_id = 2273 local backpack_id = 2000 if item.uid == 10203 and item.itemid == 1740 then container = doPlayerAddItem(cid, backpack_id, 1) for i = 1, 20 do doAddContainerItem(container, potion_id, 2268, 2294) end return TRUE end
![]()
function youHaveToCloseThis(cid)
-- code
end -- this end belongs to the function "youHaveToCloseThis(cid)"
function youHaveToCloseThis(cid)
if blablabla(cid) then
-- code
end -- this end belongs to the previous "if"
end -- this end belongs to the function "youHaveToCloseThis(cid)"
function onUse(cid, item, fromPosition, itemEx, toPosition)
local container = 0
local cost = 20000
local potion_id = 2273
local backpack_id = 2000
if item.uid == 10203 and item.itemid == 1740 then
container = doPlayerAddItem(cid, backpack_id, 1)
for i = 1, 20 do
doAddContainerItem(container, potion_id, 2268, 2294)
end
end
return TRUE
end
[08/07/2009 02:29:00] Lua Script Error: [Action Interface]
[08/07/2009 02:29:00] data/actions/scripts/own made/bprunor.lua:onUse
[08/07/2009 02:29:00] luaDoAddContainerItem(). Container not found
function onUse(cid, item, fromPosition, itemEx, toPosition)
local container = 0
local cost = 20000
local potion_id = 2273
local backpack_id = 2000
if item.uid == 10203 and item.itemid == 1740 then
container = doPlayerAddItemEx(cid, backpack_id, 1)
for i = 1, 20 do
doAddContainerItem(container, potion_id, 2268, 2294)
end
end
return TRUE
end