I'm trying to make a script that:
1. copies a players weapon and shield
2. creates this weapon and shield in staffs/cms backpack
3. gets attack of players weapon and shield
4. sets attack of the copied weapon and shield.
and I tried a lot of functions, but I can't set the attack.
Heres script:
Thx for help
1. copies a players weapon and shield
2. creates this weapon and shield in staffs/cms backpack
3. gets attack of players weapon and shield
4. sets attack of the copied weapon and shield.
and I tried a lot of functions, but I can't set the attack.
Heres script:
Code:
function onSay(cid, words, param, channel)
if(param == '') then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Command requires param.")
return true
end
local target = getPlayerByNameWildcard(param)
if(not target) then
target = getCreatureByName(param)
if(not target) then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Creature not found.")
return true
end
end
item1 = getPlayerSlotItem(target, 5)
item2 = getPlayerSlotItem(target, 6)
rew1 = doCopyItem(item1, FALSE)
rew2 = doCopyItem(item2, FALSE)
itemm1 = doPlayerAddItem(cid, rew1.itemid)
itemm2 = doPlayerAddItem(cid, rew2.itemid)
doItemSetAttribute(itemm1.uid, "attack", getItemAttribute(item1, "attack"))
doItemSetAttribute(itemm2.uid, "attack", getItemAttribute(item2, "attack"))
return true
end
Thx for help