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

Lua Quest - from tree or floor (TFS 1.0)

Easy action/movements. Give me a sec..

#EDIT
@ FIRST!

1)Give Actionid (3000) for tree in map editor.
2)Make a treequest.lua in actions/scripts.

PASTE IN actions.xml
Code:
<action actionid="3000" event="script" value="treequest.lua"/>
PASTE IN treequest.lua
Code:
local config = {
    storage = 5100
}
function onUse(cid, item, fromPosition, itemEx, toPosition)
    if(getPlayerStorageValue(cid, config.storage) < 1) then
    doPlayerAddItem(cid, itemid, 1)
    doPlayerSendTextMessage(cid,25,"You have found a item name.")
    setPlayerStorageValue(cid, 5100, 1)
    else
        doPlayerSendTextMessage(cid,MESSAGE_INFO_DESCR, "The tree is empty.")
    end
    return true
end

doPlayerAddItem(cid, itemid, 1) -- change to item id.
doPlayerSendTextMessage(cid,25,"You have found a item name.") -- name of item.

@ SECOND!

1)Give Actionid (3001) for floor in map editor.
2)Make a floorquest.lua in movements/scripts.
PASTE IN movements.xml
Code:
<movevent type="StepIn" actionid="3001" event="script" value="floorquest.lua" />
PASTE IN floorquest.lua
Code:
function onStepIn(cid, item, pos)
if getPlayerStorageValue(cid,12900) < 1 and isPlayer(cid) == TRUE then
    doPlayerAddItem(cid, itemid, 1)
    doPlayerSendTextMessage(cid,25,"You have found a item name.")
    setPlayerStorageValue(cid,12900,1)
else
        doPlayerSendTextMessage(cid,MESSAGE_INFO_DESCR, "The floor is empty.")
    end
    return true
end


doPlayerAddItem(cid, itemid, 1) -- change to item id.
doPlayerSendTextMessage(cid,25,"You have found a item name.") -- name of item.
 
Last edited:
Back
Top