Narutimmy Posted July 11, 2013 Posted July 11, 2013 Hola bueno quiero que al ser atacado la Humanidad pierda 50 y la vida 50.. pero no pasa.. cual es el error? Cl ---Matar 1 function bot ( attacker ) local id2 = getElementModel ( slothbot1 ) if attacker == slothbot1 then -- if ( getElementType ( attacker ) == "ped" ) then if (getElementModel(slothbot1) == 35 ) then setElementHealth ( source, getElementHealth(source) - 50 ) humanidad = humanidad - 50 end end end addEventHandler("onClientPlayerDamage", getRootElement(), bot) end
Castillo Posted July 11, 2013 Posted July 11, 2013 addEventHandler("onClientPlayerDamage", getRootElement(), bot) Tiene que ir despues del ultimo 'end', ademas, 'slothbot1' no esta definido en el server side?
Narutimmy Posted July 11, 2013 Author Posted July 11, 2013 Quieres que le quite a todos 50 de vida? Quiero que el que use el modelo 35 al golpear a una persona le quite 50 de vida
MTA Team 0xCiBeR Posted July 11, 2013 MTA Team Posted July 11, 2013 Seria mas o menos asi:(fijate si anda) Acordate que de ponerlo en el client-side de el resource de humanidad ---Matar 1 function bot ( attacker ) local id2 = getElementModel ( attacker ) if (id2 == 35) then setElementHealth ( localPlayer, getElementHealth(localPlayer) - 50 ) humanidad = humanidad - 50 end end addEventHandler("onClientPlayerDamage", getRootElement(), bot)
Recommended Posts