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

[REQUEST] use scroll, get item! rep++

Dramix

New Member
Joined
Jun 26, 2009
Messages
289
Reaction score
1
Hello, i use 0,4 distro, and i need help with a script, that if i use a scroll, the scroll dissapear and ill get a new item in my backpack! rep++ for help
 
data/actions/actions.xml
XML:
<action itemid="SCROLLID" script="scrolluse.lua"/>
data/actions/scripts/scrolluse.lua
LUA:
function onUse(cid, item, fromPosition, itemEx, toPosition)
        if itemEx.itemid == SCROLLID then
           if getPlayerItemCount(cid, GOLDENARMORID) < 1 then
             doPlayerSendTextMessage(cid,22,'You dont have golden armor.')
        else
	     doRemoveItem(cid, item.uid, 1)
             doPlayerRemoveItem(cid, GOLDENARMORID, 1)
	     doPlayerAddItem(cid,ITEMID,1)
           end
        end
end
Don't forget to change these..

GOLDENARMORID = ID of golden armor..
ITEMID = The ID of the item you get..
SCROLLID = The ID of the scroll..
 
Last edited:
Back
Top