Witam! Gdy doda?em do ots skrypt
local nagrody = {
[1] = {{itemid, ile}, {itemid, ile}, {itemid, ile}} --itemy dla sorca
[2] = {{itemid, ile}, {itemid, ile}, {itemid, ile}} --itemy dla druida
[3] = {{itemid, ile}, {itemid, ile}, {itemid, ile}} --itemy dla palla
[4] = {{itemid, ile}, {itemid, ile}, {itemid, ile}} --itemy dla knighta
}
local questid = 123123
function onUse(cid, item, frompos, item2, topos)
local msg = "It is empty."
if(getPlayerStorageValue(cid, questid) == -1)then
local voc = getPlayerVocation(cid)
if(voc >= 1)then
msg = "You have found a"
for i,_ in pairs(nagrody[voc]) do
local id, count = nagrody[voc][1], nagrody[voc][2]
doPlayerAddItem(cid, id, count)
msg = msg .. (i == 1 and " " or ", ") .. getItemName(id) .. "(" .. count .. ")"
end
msg = msg .. "."
doPlayerSendTextMessage(cid, 22, msg)
setPlayerStorageValue(cid, questid, 1)
else
doPlayerSendTextMessage(cid, 22, "Critical error you have incorrect vocation!")
end
else
doPlayerSendTextMessage(cid, 22, msg)
end
return 1
end
jest tak b??d:
data/actions/scripts/itemprof.lua:3: '}' expected <to close '{' at line 1> near '['
z g?ry dzi?ki za pomoc ;]
local nagrody = {
[1] = {{itemid, ile}, {itemid, ile}, {itemid, ile}} --itemy dla sorca
[2] = {{itemid, ile}, {itemid, ile}, {itemid, ile}} --itemy dla druida
[3] = {{itemid, ile}, {itemid, ile}, {itemid, ile}} --itemy dla palla
[4] = {{itemid, ile}, {itemid, ile}, {itemid, ile}} --itemy dla knighta
}
local questid = 123123
function onUse(cid, item, frompos, item2, topos)
local msg = "It is empty."
if(getPlayerStorageValue(cid, questid) == -1)then
local voc = getPlayerVocation(cid)
if(voc >= 1)then
msg = "You have found a"
for i,_ in pairs(nagrody[voc]) do
local id, count = nagrody[voc][1], nagrody[voc][2]
doPlayerAddItem(cid, id, count)
msg = msg .. (i == 1 and " " or ", ") .. getItemName(id) .. "(" .. count .. ")"
end
msg = msg .. "."
doPlayerSendTextMessage(cid, 22, msg)
setPlayerStorageValue(cid, questid, 1)
else
doPlayerSendTextMessage(cid, 22, "Critical error you have incorrect vocation!")
end
else
doPlayerSendTextMessage(cid, 22, msg)
end
return 1
end
jest tak b??d:
data/actions/scripts/itemprof.lua:3: '}' expected <to close '{' at line 1> near '['
z g?ry dzi?ki za pomoc ;]