Muito bom kra, criativo ;]
Não testei, mas imagino que funcione kkk, só tem um erro aqui:
elseif slotRight.uid > 0 then
if (multi*getPlayerSkill(pid, skill)) >= 1999 then
doItemSetAttribute(slotLeft.uid, "attackspeed", 1)
else
doItemSetAttribute(slotLeft.uid, "attackspeed", 2000-(multi*getPlayerSkill(pid, skill)))
end
No caso, slotRight...
Eu escrevi aqui no creaturescripts, deve funcionar também:
function onThink(cid, interval)
local multi = 200
local skill = 2
local limite = 99
local slotLeft, slotRight = getPlayerSlotItem(cid, CONST_SLOT_LEFT), getPlayerSlotItem(cid, CONST_SLOT_RIGHT)
if last_interval == nil then last_interval= os.clock() end
if (os.clock() - last_interval) > 1 then
if slotLeft.uid > 0 then
if (multi*getPlayerSkill(cid, skill)) >= limite then
doItemSetAttribute(slotLeft.uid, "attackspeed", 1)
else
doItemSetAttribute(slotLeft.uid, "attackspeed", 2000-(multi*getPlayerSkill(cid, skill)))
end
elseif slotRight.uid > 0 then
if (multi*getPlayerSkill(cid, skill)) >= limite then
doItemSetAttribute(slotRight.uid, "attackspeed", 1)
else
doItemSetAttribute(slotRight.uid, "attackspeed", 2000-(multi*getPlayerSkill(cid, skill)))
end
end
last_interval= os.clock()
return true
end
return false
end
Mas imagino que o bug esteja na repetição, então, como o servidor vai ficar sendo carregado o tempo inteiro com o script, o andar automático, por exemplo, será interrompido...isso pelo creaturescripts, mas talvez pelo global também, não sei.