local questdoll = {ID OF THE ITEM YOU WANT TO SELL}
function onUse(cid, item, frompos, item2, topos)
if getPlayerStorageValue(cid,STORAGE NUMBER) == -1 then
doPlayerSendTextMessage(cid,19,"MSG WHEN USE THE ITEM")
setPlayerStorageValue(cid,STORAGE NUMBER,1)
doPlayerRemoveItem(cid, questdoll, 1)
else
doPlayerSendTextMessage(cid,19,"You already done this quest..")
end
end
return TRUE
end
function onUse(cid, item, frompos, item2, topos)
if getPlayerStorageValue(cid,12139) == -1 then
doPlayerSendTextMessage(cid,19,"shaggy es pro")
setPlayerStorageValue(cid,12139,1)
doRemoveItem(item.uid)
else
doPlayerSendTextMessage(cid,19,"You already done this quest..")
end
return TRUE
end
that means u are not prothis is wht i have but dont work
local questdoll = {9019}
function onUse(cid, item, frompos, item2, topos)
if getPlayerStorageValue(cid,12139) == -1 then
doPlayerSendTextMessage(cid,19,"shaggy es pro")
setPlayerStorageValue(cid,12139,1)
doPlayerRemoveItem(cid, questdoll, 1)
else
doPlayerSendTextMessage(cid,19,"You already done this quest..")
end
end
return TRUE
end
LOL im pro in CTRLC CTRLV!that means u are not pro
Sry, dont know how to convert. I tryed to migrate from TFS 0.4 to TFS 1.2, without success, all functions are new, i wasnt able to convert a single actions kkkknop I use tf 1.2 client 10.98
<action itemid="xxxx" script="djin.lua" /> -- xxxx = id of the item, preferably something that can be put in your bp
function onUse(player, item, fromPosition, target, toPosition, isHotkey)
local storage = player:getStorageValue(xxxx) -- Put your own storage value instead of xxxx
if storage == -1 then
player:setStorageValue(xxxx, 1) -- change xxxx again
player:sendTextMessage(MESSAGE_INFO_DESCR, 'You can now access the djin tower.')
item:remove(1)
elseif storage == 1 then
player:sendTextMessage(MESSAGE_INFO_DESCR, 'You already have this quest')
return true
end
end