SU

Reborn Feito Por

Por Subwat, 14 de set. de 2011 em Archived

script
3
822
SubwatS
15 de setembro de 2011 às 11:09

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
end

 

 

 

se alguem conseguir corrigir agradeço mt obrigado.

flw

 

:( up.

VodkartV
15 de setembro de 2011 às 20:08

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

SubwatS
16 de setembro de 2011 às 10:32

Funcionou,valeu manow.

Beijinhos na bokinha