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 mtasa://66.85.14.178:22003 Ts3: thezombiworld.com:7777
NodZen Posted July 11, 2013 Posted July 11, 2013 Quieres que le quite a todos 50 de vida? ------------------------------------------------------------------------------------------ My scripts http://community.multitheftauto.com/index.php?p=resources&s=details&id=6977 http://community.multitheftauto.com/index.php?p=resources&s=details&id=7740
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? San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
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 mtasa://66.85.14.178:22003 Ts3: thezombiworld.com:7777
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) DevOps Engineer, Cloud Advocate & Security Engineer(Red Team) | Coffee, Containers & Burp
Castillo Posted July 11, 2013 Posted July 11, 2013 Porque no lo haces server side? San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
Recommended Posts