local ItemId = XXXX -- Token ID
local DonItem = XXXX -- ID Of Donor Item
function onUse(cid, item, frompos, item2, topos)
doPlayerAddItem(cid, DonItem)
doPlayerRemoveItem(cid, ItemId, 1)
return 1
end
lrn2tabLUA:local ItemId = XXXX -- Token ID local DonItem = XXXX -- ID Of Donor Item function onUse(cid, item, frompos, item2, topos) doPlayerAddItem(cid, DonItem) doPlayerRemoveItem(cid, ItemId, 1) return 1 end
this is untested hope it works
local token = 2624
local possibleItems = {2485, 2023, 2039, 2049, 3567} -- change for whatever the fuck you want to get from tokens
function onUse(cid, item, frompos, item2, topos)
if doRemoveItem(cid, token, 1) then
local newItem = math.random(#possibleItems)
doPlayerAddItem(cid, newItem, 1)
doPlayerSendTextMessage(cid, MESSAGE_CONSOLE_STATUS_BLUE, "You got a ".. getItemInfo(newItem).name ..".")
end
return true
end
lrn2tab
Change "xxxx" and all the others to itemid's and it will randomize the item to get, I won't give you the actions.xml code.LUA:local token = 2624 local newItem = math.random(xxxx, yyyy, zzzz, aaaa, bbbb, cccc) --Change for whatever the fuck you want to get from using the tokens function onUse(cid, item, frompos, item2, topos) if doRemoveItem(cid, 2624, 1) then doPlayerAddItem(cid, newItem, 1) doPlayerSendTextMessage(cid, MESSAGE_CONSOLE_STATUS_BLUE, "You got a ".. newItem ..".") end return true end