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

Script issue

tatara

New Member
Joined
Jan 1, 2023
Messages
36
Reaction score
3
GitHub
Tatara
Hi, i got and issue with script.

function onUse(cid, item, frompos, item2, topos)
doTransformItem(item.uid, 2229,100)
doPlayerSendTextMessage(cid,22,'You have found 100 Flawless skulls')
end

The item says the text that it supposed to say, but for some reason it do not change the item into skulls, any suggestions how it can be resolved ?
 
Seems ok to me, Maybe add a return true.
Lua:
function onUse(cid, item, frompos, item2, topos)
    doTransformItem(item.uid, 2229, 100)
    doPlayerSendTextMessage(cid, 22, "You have found 100 Flawless skulls")
    return true
end
 
Seems ok to me, Maybe add a return true.
Lua:
function onUse(cid, item, frompos, item2, topos)
    doTransformItem(item.uid, 2229, 100)
    doPlayerSendTextMessage(cid, 22, "You have found 100 Flawless skulls")
    return true
end
still same, says the message but item not used.
 
Which TFS? Script works on 0.x perfectly.
quickTest.gif
How did you add it to your XML?
 
Might be some ancient engine where doTransformItem doesn't allow count, So try it like this.
doTransformItem(item.uid, 2229)
 
So as I assumed, doTransformItem doesn't take count argument.
Maybe try something like this.
Lua:
function onUse(cid, item, frompos, item2, topos)
    doRemoveItem(item.uid, item.type)
    doPlayerAddItem(cid, 2229, 100)
    doPlayerSendTextMessage(cid, 22, "You have found 100 Flawless skulls")
    return true
end
 
Last edited:
So as I assumed, doTransformItem doesn't take count argument.
Maybe try something like this.
Lua:
function onUse(cid, item, frompos, item2, topos)
    doRemoveItem(item.uid)
    doCreateItem(2105, 100, frompos)
    doPlayerSendTextMessage(cid, 22, "You have found 100 Flawless skulls")
    return true
end
1. Item do not use
2. After clicking on item, server crash
 
Edited copy again and retry.
If it still doesn't work then change item.itemid to 2137
 
Back
Top