• 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!

Cant make my chest working

gappe

New Member
Joined
Jul 17, 2009
Messages
71
Reaction score
0
I have noticed that you cant just make a quest chest in tfs 0.3.5pl in the mapeditor, so i need to script it, i put in an action script like this

function onUse(cid, item, fromPosition, itemEx, toPosition)
local poz = getPlayerPosition(cid)
if item.uid == 2432 then
item = 2432
stor = 1000
if(getPlayerStorageValue(cid,stor) == -1) then
if(doPlayerAddItem(cid,item,1, FALSE)) then
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You have found a ".. getItemNameById(item) ..".")
setPlayerStorageValue(cid,stor,1)
doSendAnimatedText(poz, "GrEaTz!", TEXTCOLOR_WHITE)
else
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You have found a ".. getItemNameById(item) .." reward weighing " .. getItemWeightById(item,1) .. " oz. It is too heavy or you have not enough space.")
end
else
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "It is empty.")
end
end
return TRUE
end

Then i put this line in my actions.xml

<action uniqueid="1000" event="script" value="questchest.lua"/>

and in the mapedtior i put unique id 1000? it doesent work, im so damn noob at lua and stuff so could someone explain in a childish way, like if you would explain for a 3 year old? !
 
I have noticed that you cant just make a quest chest in tfs 0.3.5pl in the mapeditor, so i need to script it, i put in an action script like this



Then i put this line in my actions.xml



and in the mapedtior i put unique id 1000? it doesent work, im so damn noob at lua and stuff so could someone explain in a childish way, like if you would explain for a 3 year old? !

It works with mapeditor =p But most people download converted and old servers, that has questsystem.lua or quest.lua, go to your actions folder, go to quests and look if you have a system.lua, then check if you have this in actions.xml, if not add it and remove the old quest.lua or whatever it was.

Code:
	<action actionid="2000" event="script" value="quests/system.lua"/>
	<action actionid="2001" event="script" value="quests/system.lua"/>


Then enter mapeditor, go to a chest add 2000 as action id, unique id as a storagevalue (any value) and then at the small black things, add your item you want the people to get.
 
It doesent work, when i press the chest it "poffs" like someones attacking me but doesent take any dmg

can anyone help to make this work??
 
Last edited by a moderator:
I can help you :)

Just take it :
Code:
-- Quests.

function onUse(cid, item, frompos, item2, topos)

    if item.uid == 90020 then
queststatus = getPlayerStorageValue(cid,90020)
if queststatus == -1 then
    doPlayerSendTextMessage(cid,22,"You have found Bp of Holding.")
    doPlayerAddItem(cid,2365,1)
    setPlayerStorageValue(cid,90020,1)
else
    doPlayerSendTextMessage(cid,22,"The chest is empty.")
end

    elseif item.uid == 90021 then
queststatus = getPlayerStorageValue(cid,90021)
if queststatus == -1 then
    doPlayerSendTextMessage(cid,22,"You have found 100k.")
    doPlayerAddItem(cid,2160,10)
    setPlayerStorageValue(cid,90021,1)
else
    doPlayerSendTextMessage(cid,22,"The chest is empty.")
end

    end
return 1
end

You can add your quests by coppy it down and change storagevalue.
Code:
    elseif item.uid == 90021 then
queststatus = getPlayerStorageValue(cid,90021)
if queststatus == -1 then
    doPlayerSendTextMessage(cid,22,"You have found 100k.")
    doPlayerAddItem(cid,2160,10)
    setPlayerStorageValue(cid,90021,1)
else
    doPlayerSendTextMessage(cid,22,"The chest is empty.")
end

To actions
Code:
<action uniqueid="90020" script="quests/quest-box.lua" />
<action uniqueid="90021" script="quests/quest-box.lua" />

Dont forgot to add next line when you make another quest in quest-box.lua !
 
Back
Top Bottom