Aeronx
Intermediate OT User
- Joined
- Dec 17, 2015
- Messages
- 746
- Solutions
- 9
- Reaction score
- 125
Hello everyone, and thanks for reading this post and for your time.
Basicaly is what the tittle says. I want to use an item on a (for exemple) a weapon and add an actionid and a text to it.
I did this script here and works perfect when set to a chest for exemple:
I've been messing around and tried many versions of this:
I get the error target (a nil value).. so what im doing wrong? Im not an expert obviously, not even close, very amateur.
Thanks again!
NOTE: Solved the error on console target (a nil value) by adding <function onUse(cid, target...)>
So now, after using the item on the item 2382 nothing happens.
Basicaly is what the tittle says. I want to use an item on a (for exemple) a weapon and add an actionid and a text to it.
I did this script here and works perfect when set to a chest for exemple:
Code:
function onUse(cid, item, fromPosition, itemEx, toPosition)
local key = doCreateItemEx(2382, 1)
local text = "XXXXX"
doPlayerSendTextMessage(cid,25,"YYYYYYY")
doSetItemActionId(2382, 3520)
doSetItemSpecialDescription(2382, text)
doPlayerAddItemEx(cid, key, 1)
end
return true
end
I've been messing around and tried many versions of this:
Code:
function onUse(cid, item, fromPosition, itemEx, toPosition)
local text = "XXXXXX"
if target.itemid == 2382 then
doPlayerSendTextMessage(cid,25,"YYYYYY")
doSetItemActionId(2382, 3520)
doSetItemSpecialDescription(2382, text)
end
return true
end
I get the error target (a nil value).. so what im doing wrong? Im not an expert obviously, not even close, very amateur.
Thanks again!
NOTE: Solved the error on console target (a nil value) by adding <function onUse(cid, target...)>
So now, after using the item on the item 2382 nothing happens.
Last edited: