Big Smoker Posted January 28, 2019 Share Posted January 28, 2019 (edited) Boa Noite, não queria vim pedir ajuda no forum mas fui forçado a pedir ajuda eu to com problema de aviso numa linha do script que tava criando no Client.lua.. a função é quando da dano no ped (zombie) na linha eu coloco o Blood do zombie > 0 só que quando da numo menor que 0 ele da aviso. AVISO === attempt to compare with number boolean if getElementData(source,"bloodZumbie") > 0 then -- aviso aqui if weapon == 0 then damage = 2500 else damage = getWeaponDamage(weapon,attacker) end if bodypart == 9 then damage = damage * 9.5 headshot = true end setElementData(source, "bloodZumbie", getElementData(source, "bloodZumbie") - math.random(damage * 0.75, damage * 1.25)) outputChatBox("DANO ZUMBIE: "..damage.." / "..getElementData(source,"bloodZumbie")) if getElementData(source,"bloodZumbie") <= 0 and not getElementData(source,"isDeadZumbie") then triggerServerEvent("onZombieGetsKilled", source, attacker, headshot, getWeaponNameFromID(weapon)) setElementData ( source, "isDeadZumbie", true ) outputChatBox("MATOU") end end Edited January 28, 2019 by felipebaidoloko Link to comment
DNL291 Posted January 28, 2019 Share Posted January 28, 2019 Tente: if (getElementData(source,"bloodZumbie") or 0) > 0 then -- aviso aqui if weapon == 0 then damage = 2500 else damage = getWeaponDamage(weapon,attacker) end if bodypart == 9 then damage = damage * 9.5 headshot = true end setElementData(source, "bloodZumbie", getElementData(source, "bloodZumbie") - math.random(damage * 0.75, damage * 1.25)) outputChatBox("DANO ZUMBIE: "..damage.." / "..getElementData(source,"bloodZumbie")) if getElementData(source,"bloodZumbie") <= 0 and not getElementData(source,"isDeadZumbie") then triggerServerEvent("onZombieGetsKilled", source, attacker, headshot, getWeaponNameFromID(weapon)) setElementData ( source, "isDeadZumbie", true ) outputChatBox("MATOU") end end Link to comment
brunob22 Posted January 28, 2019 Share Posted January 28, 2019 attempt to compare with number boolean <= auto explicativo voce nao pode comparar um boolean em numero Link to comment
Big Smoker Posted January 28, 2019 Author Share Posted January 28, 2019 @DNL291 OBRIGADO DEU CERTO! 1 Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now