You didn't change what I said...
On line 7, change:
local item1 = getPlayerSlotItem(cid, CONST_SLOT_RIGHT)
to:
local item1 = Player(cid):getSlotItem(CONST_SLOT_RIGHT)
On line 19, change:
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Put item in right hand.")
to...