• 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!
  • 2026 staff recruitment is open! Check it out and consider applying!

voc chest..

Zerak456

Gorlex.net NEW!
Joined
Aug 13, 2008
Messages
1,060
Reaction score
6
hello guys i need voc chests..

like if ur sorcerer u can open a chest u get a bp with sorcerer items

also not only sorcerer i mean 1-4 vocs need it to my serv...


please i dont know this xD i rep++

REP++ is nothing for me..
 
Try now:
LUA:
function onUse(cid, item, fromPos, item2, topos)
    local storage = getPlayerStorageValue(cid, XXXXX)
    if item.uid == XXXX then
        if storage < 1 then
            if isSorcerer(cid) == TRUE then
            --if player is sorcerer
            if isDruid(cid) == TRUE then
            --if player is druid
            elseif(isPaladin(cid) == TRUE) then
            --if player is paladin
            elseif(isKnight(cid) == TRUE) then
            --if player is knight
            end
        else
            doPlayerSendTextMessage(cid, 22, "It is empty.")
        end
    end
    return TRUE
end
Ofc paste your code instead of commented lines (--)
 
[08/06/2009 07:45:16] Warning: [Event::loadScript] Can not load script. data/actions/scripts/vocs.lua
[08/06/2009 07:45:16] data/actions/scripts/vocs.lua:6: unexpected symbol near '-'
[08/06/2009 07:45:16] Warning: [Event::loadScript] Can not load script. data/actions/scripts/vocs.lua
[08/06/2009 07:45:16] data/actions/scripts/vocs.lua:6: unexpected symbol near '-'
[08/06/2009 07:45:16] Warning: [Event::loadScript] Can not load script. data/actions/scripts/vocs.lua
[08/06/2009 07:45:16] data/actions/scripts/vocs.lua:6: unexpected symbol near '-'
[08/06/2009 07:45:16] Warning: [Event::loadScript] Can not load script. data/actions/scripts/vocs.lua
[08/06/2009 07:45:16] data/actions/scripts/vocs.lua:6: unexpected symbol near '-'
this was my error and here is my script
function onUse(cid, item, fromPos, item2, topos)
local storage = getPlayerStorageValue(cid, 3548)
if item.uid == 3545 then
if storage < 1 then
if isSorcerer(cid) == TRUE then
- doPlayerAddItem(cid,1998,1)
doPlayerAddItem(cid,8819,1)
doPlayerAddItem(cid,8820,1)
doPlayerAddItem(cid,2298,100)
doPlayerAddItem(cid,2468,1)
doPlayerAddItem(cid,2268,100)
doPlayerAddItem(cid,2190,1)
doPlayerAddItem(cid,2187,1)
doPlayerAddItem(cid,2516,1)
doPlayerAddItem(cid,2643,1)
doPlayerAddItem(cid,2173,1)
doPlayerAddItem(cid,2160,1)-if player is sorcerer
if isDruid(cid) == TRUE then
- doPlayerAddItem(cid,1998,1)
doPlayerAddItem(cid,1998,1)
doPlayerAddItem(cid,10020,1)
doPlayerAddItem(cid,10021,1)
doPlayerAddItem(cid,2298,100)
doPlayerAddItem(cid,2468,1)
doPlayerAddItem(cid,2268,100)
doPlayerAddItem(cid,2182,1)
doPlayerAddItem(cid,2186,1)
doPlayerAddItem(cid,2516,1)
doPlayerAddItem(cid,2463,1)
doPlayerAddItem(cid,2173,1)
doPlayerAddItem(cid,2160,1)-if player is druid
elseif(isPaladin(cid) == TRUE) then
- doPlayerAddItem(cid,1998,1)
doPlayerAddItem(cid,1998,1)
doPlayerAddItem(cid,2456,1)
doPlayerAddItem(cid,2457,1)
doPlayerAddItem(cid,2643,1)
doPlayerAddItem(cid,2273,100)
doPlayerAddItem(cid,2546,1)
doPlayerAddItem(cid,2543,1)
doPlayerAddItem(cid,2455,1)
doPlayerAddItem(cid,2660,1)
doPlayerAddItem(cid,8923,1)
doPlayerAddItem(cid,2173,1)
doPlayerAddItem(cid,2160,1)-if player is paladin
elseif(isKnight(cid) == TRUE) then
- doPlayerAddItem(cid,1998,1)
doPlayerAddItem(cid,2647,1)
doPlayerAddItem(cid,2457,1)
doPlayerAddItem(cid,2643,1)
doPlayerAddItem(cid,2273,100)
doPlayerAddItem(cid,2436,1)
doPlayerAddItem(cid,2432,1)
doPlayerAddItem(cid,2392,1)
doPlayerAddItem(cid,2516,1)
doPlayerAddItem(cid,2463,1)
doPlayerAddItem(cid,2173,1)
doPlayerAddItem(cid,2160,1)-if player is knight
end
else
doPlayerSendTextMessage(cid, 22, "It is empty.")
end
end
return TRUE
end

-.- thats right script?
 
LUA:
local itemsSorcerer = 
{
  1998,
  8819,
  8820
}

local itemsDruid = 
{
  1998,
  8819,
  8820
}

local itemsPaladin = 
{
  1998,
  8819,
  8820
}

local itemsKnight = 
{
  1998,
  8819,
  8820
}

local storageValue = {12545}

function onUse(cid, item, fromPos, item2, topos)
    if getPlayerStorageValue(cid, storageValue) == -1 then
        if(isSorcerer(cid) == TRUE) then
		for i = 1, table.maxn(itemsSorcerer) do
			doPlayerAddItem(cid, itemsSorcerer[i], 1)
		end
			setPlayerStorageValue(cid, storageValue, 1)			
        elseif(isDruid(cid) == TRUE) then
		for i = 1, table.maxn(itemsDruid) do
			doPlayerAddItem(cid, itemsDruid[i], 1)
		end
			setPlayerStorageValue(cid, storageValue, 1)
        elseif(isPaladin(cid) == TRUE) then
		for i = 1, table.maxn(itemsPaladin) do
			doPlayerAddItem(cid, itemsPaladin[i], 1)
		end
			setPlayerStorageValue(cid, storageValue, 1)
        elseif(isKnight(cid) == TRUE) then
		for i = 1, table.maxn(itemsKnight) do
			doPlayerAddItem(cid, itemsKnight[i], 1)
		end
                        setPlayerStorageValue(cid, storageValue, 1)			
        end
    else
        doPlayerSendTextMessage(cid, 22, "It is empty.")
    end
    return TRUE
end
 
Last edited:
dont work but i search in the list and i found one from colandus :) WORKING!! here it is
--##>> CONFIG <<##--
local storageValue = 5464 --## Storage value to be set on the player! ##--

local rewards = { --## Rewards you'll get when you finish the quest! ##--
sorcerer = {2160, 1},
druid = {itemid, count},
paladin = {itemid, count},
knight = {itemid, count}
}

local vocations = { --## Vocation information! ##--
sorcerer = {1, 5},
druid = {2, 6},
paladin = {3, 7},
knight = {4, 8}
}
--##>> CONFIG <<##--

function onUse(cid, item, frompos, item2, topos)
if getPlayerStorageValue(cid, storageValue) == -1 then
for vocName, vocIds in pairs(vocations) do
if isVocation(cid, vocIds) then
doPlayerAddItem(cid, rewards[vocName][1], rewards[vocName][2])
doPlayerSendTextMessage(cid,25, "You have found a ".. getItemName(rewards[vocName]) ..".")
setPlayerStorageValue(cid, storageValue, 1)
return TRUE
end
end
else
doPlayerSendCancel(cid, "You already got your reward!")
end
return TRUE
end

function isVocation(cid, vocs)
return isInArray(vocs, getPlayerVocation(cid)) == 1
end

from colandus :) so im givin him rep++ now :) and all who gaved me scripts but not worked i give them to :)
 
@UP
i can re-write the script, more advanced etc...

but if its your problem...just add:
LUA:
        elseif(isPaladin(cid) == TRUE) then
                for i = 1, table.maxn(itemsPaladin) do
                        doPlayerAddItem(cid, itemsPaladin[i], 1)
                end
                        setPlayerStorageValue(cid, storageValue, 1)
                        doPlayerAddItem(cid, spearID, 5)
                        doPlayerAddItem(cid, arrowsID, 100)
 
Oh, now I think my will work :p
LUA:
function onUse(cid, item, frompos, item2, topos)

        if item.uid == XXXX and isSorcerer(cid) == 1 then
                queststatus = getPlayerStorageValue(cid,XXXX)
                if queststatus == -1 then
                        doPlayerSendTextMessage(cid,22,"You have found an XXXX.")
                        doPlayerAddItem(cid,XXXX,1)
                        setPlayerStorageValue(cid,XXXX,1)
                else
                        doPlayerSendTextMessage(cid,22,"It is empty.")
                end
        elseif item.uid == XXXX and isDruid(cid) == 1 then
                queststatus = getPlayerStorageValue(cid,XXXX)
                        queststatus == -1 then
                        doPlayerSendTextMessage(cid,22,"You have found an XXXX.")
                        doPlayerAddItem(cid,XXXX,1)
                        setPlayerStorageValue(cid,XXXX,1)
                else
                        doPlayerSendTextMessage(cid,22,"It is empty.")
                end
        elseif item.uid == XXXX and isPaladin(cid) == 1 then
                queststatus = getPlayerStorageValue(cid,XXXX)
                if queststatus == -1 then
                        doPlayerSendTextMessage(cid,22,"You have found an XXXX.")
                        doPlayerAddItem(cid,XXXX,1)
                        setPlayerStorageValue(cid,XXXX,1)
                else
                        doPlayerSendTextMessage(cid,22,"It is empty.")
                end
        elseif item.uid == XXXX and isKnightcid) == 1 then
                queststatus = getPlayerStorageValue(cid,XXXX)
                if queststatus == -1 then
                        doPlayerSendTextMessage(cid,22,"You have found an XXXX.")
                        doPlayerAddItem(cid,XXXX,1)
                        setPlayerStorageValue(cid,XXXX,1)
                else
                        doPlayerSendTextMessage(cid,22,"It is empty.")
                end
        else
                return 0
        end

        return 1
end

but it will not give Backpack with items
 
@UP
i can re-write the script, more advanced etc...

but if its your problem...just add:
LUA:
        elseif(isPaladin(cid) == TRUE) then
                for i = 1, table.maxn(itemsPaladin) do
                        doPlayerAddItem(cid, itemsPaladin[i], 1)
                end
                        setPlayerStorageValue(cid, storageValue, 1)
                        doPlayerAddItem(cid, spearID, 5)
                        doPlayerAddItem(cid, arrowsID, 100)

i dont understand.. no itemID or uID on your script?

sry for being noobish but im trying to learn scripting :)
 
-_-

you'll set it at actions.xml

edit

EX:
PHP:
	<action actionid="34234" event="script" value="quest.lua"/>

PHP:
function onUse(cid, item, fromPosition, itemEx, toPosition) 
    if getPlayerStorageValue(cid, 34344) == -1 then 
	    doPlayerAddItem(cid, 4545, 1)
        setPlayerStorageValue(cid, 34344, 1)
	else
        doPlayerSendCancel(cid, "empty.")	
	end	
	return TRUE
end


now go map editor and set actionID to 34234.
 
Back
Top