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

Use Item Give X and Y

Lifer420

Advanced OT User
Joined
Jul 27, 2009
Messages
1,490
Reaction score
196
I need a script for an item, 12345, that when a player uses it it gives them 2 items, 5 of each

If use item 12345, give player item 1234[count 5] and item 2345[count 5]

Anyone?
 
Code:
function onUse(cid, item, fromPosition, itemEx, toPosition)
    if getPlayerItemById(cid, 12345) then
        doPlayerAddItem(cid, 1234, 5)
        doPlayerAddItem(cid, 2345, 5)
    end
    return true
end

Shuld work, shure it can be written much nicer but i do what i can.
 
Code:
function onUse(cid, item, fromPosition, itemEx, toPosition)
    if getPlayerItemById(cid, 12345) then
        doPlayerAddItem(cid, 1234, 5)
        doPlayerAddItem(cid, 2345, 5)
    end
    return true
end

Shuld work, shure it can be written much nicer but i do what i can.

Where do I add this? Data/Actions/NAME.lua?
 
I got that part already, thanks though. Can you help with
Code:
http://otland.net/threads/mission-npc-addition.208399/#post-1996490
 
Back
Top