local SwitchId = XXX -- ID of the switch
local Token = XXX, X -- ID of the token (ID, count)
local Item = XXX, X -- ID of item to buy (ID, count)
function onUse(cid, item, frompos, item2, topos)
if item.itemid == SwitchId and getPlayerItemCount(cid, Token) == TRUE then
doPlayerRemoveItem(cid...