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

Need some help!

White Rabbit

sereniaot.org
Joined
Apr 12, 2009
Messages
239
Reaction score
11
Location
Sweden
What is wrong?


[09/12/2009 19:20:12] [Warning - Event::loadScript] Cannot load script (data/actions/scripts/theend/demonoak/demonOakChests.lua)
[09/12/2009 19:20:12] data/actions/scripts/theend/demonoak/demonOakChests.lua:40: 'end' expected (to close 'function' at line 1) near '<eof>'
 
PHP:
function onUse(cid, item, fromPosition, itemEx, toPosition)

        if item.uid == 12901 then
                queststatus = getPlayerStorageValue(cid, 12900)
                if queststatus < 1 then
                        doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You have found a Demon Legs.")
                        doPlayerAddItem(cid, 2495, 1)
                        doPlayerSetStorageValue(cid, 12900, 1)
                else
                        doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "It is empty.")
                end
        elseif item.uid == 12902 then
                queststatus = getPlayerStorageValue(cid, 12900)
                if queststatus < 1 then
                        doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You have found a Rainbow Shield.")
                        doPlayerAddItem(cid, 8905, 1)
                        doPlayerSetStorageValue(cid, 12900, 1)
                else
                        doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "It is empty.")
                end
        elseif item.uid == 12903 then
                queststatus = getPlayerStorageValue(cid, 12900)
                if queststatus < 1 then
                        doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You have found a Spellbook of Dark Mysteries.")
                        doPlayerAddItem(cid, 8918, 1)
                        doPlayerSetStorageValue(cid, 12900, 1)
                else
                        doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "It is empty.")
                end
        elseif item.uid == 12904 then
                queststatus = getPlayerStorageValue(cid, 12900)
                if queststatus < 1 then
                        doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You have found a Royal Crossbow.")
                        doPlayerAddItem(cid, 8851, 1)
                        doPlayerSetStorageValue(cid, 12900, 1)
                else
                        doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "It is empty.")
                
             return TRUE

           end
 
Use this one it's kinda easy to understand this one:

Code:
function onUse(cid, item, fromPosition, itemEx, toPosition)

        if item.uid == 12901 then
                queststatus = getPlayerStorageValue(cid, 12900)
                if queststatus < 1 then
                        doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You have found a Demon Legs.")
                        doPlayerAddItem(cid, 2495, 1)
                        doPlayerSetStorageValue(cid, 12900, 1)
                else
                        doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "It is empty.")
                end
        elseif item.uid == 12902 then
                queststatus = getPlayerStorageValue(cid, 12900)
                if queststatus < 1 then
                        doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You have found a Rainbow Shield.")
                        doPlayerAddItem(cid, 8905, 1)
                        doPlayerSetStorageValue(cid, 12900, 1)
                else
                        doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "It is empty.")
                end
        elseif item.uid == 12903 then
                queststatus = getPlayerStorageValue(cid, 12900)
                if queststatus < 1 then
                        doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You have found a Spellbook of Dark Mysteries.")
                        doPlayerAddItem(cid, 8918, 1)
                        doPlayerSetStorageValue(cid, 12900, 1)
                else
                        doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "It is empty.")
                end
        elseif item.uid == 12904 then
                queststatus = getPlayerStorageValue(cid, 12900)
                if queststatus < 1 then
                        doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You have found a Royal Crossbow.")
                        doPlayerAddItem(cid, 8918, 1)
                        doPlayerSetStorageValue(cid, 12900, 1)
                else
                        doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "It is empty.")
                end
        end
                return TRUE
end
 
Back
Top