tenta
function onKill(cid, target)
if(isMonster(target) == TRUE) then
local monster,chance,erro = getCreatureName(target),math.random(1, 100),50
if chance >= 1 and chance <= erro then
doPlayerSendCancel(cid, "You killed a".. getCreatureName(target) .." .")
return TRUE
end
doConvinceCreature(cid, doCreateMonster("".. getCreatureName(target) .."", playerpos))
doSendAnimatedText(playerpos, "back!", TEXTCOLOR_GREEN)
end
return TRUE
end




info
Group: Infante
Joined: 27/07/09
Posts: 1.5k
Reputation: +405
Tibia Character: Gean Riot
Bom eu criei um Sistema que ao matar um monstro tem 50% de chance desse monstro ser renascido na mesma hora,Só que ta nascendo sem parar,eu nao sei mecher direito com machramdom e isso é um problema,gostaria de se saber se alguem ae está disposto a corrigir meu script.
function onKill(cid, target) if(isMonster(target) == TRUE) then local monster = getCreatureName(target) chance = math.random(1) erro = 50 ------ Chance de erro if math.random(100) >= erro then doConvinceCreature(cid, doCreateMonster("".. getCreatureName(target) .."", playerpos)) doSendAnimatedText(playerpos, "back!", TEXTCOLOR_GREEN) return TRUE end else doPlayerSendCancel(cid, "You killed a".. getCreatureName(target) .." .") end endse alguem conseguir corrigir agradeço mt obrigado.
flw