golanu21 Posted July 31, 2013 Share Posted July 31, 2013 how i make with exp_system something like this : getZombieKills (i want when player kill 3 zombies to do something Link to comment
Wei Posted July 31, 2013 Share Posted July 31, 2013 if exp system uses element data you can use it like that addEventHandler ( "onClientElementDataChange", getRootElement(), function ( dataName ) if getElementType ( source ) == "player" and dataName == "exp" then if getElementData(source, "exp") == 3 then outputChatBox ("Data is 3") elseif getElementData(source, "exp") == 5 then outputChatBox ("Data is 5") end end end ) Link to comment
golanu21 Posted July 31, 2013 Author Share Posted July 31, 2013 i don't understand what you make there, man i want when player kill 3 zombies to do something .. Link to comment
Castillo Posted July 31, 2013 Share Posted July 31, 2013 The zombies resource stores kills on element data, the data name is: "Zombie kills" or "Zombie Kills". Link to comment
golanu21 Posted July 31, 2013 Author Share Posted July 31, 2013 function deanimated( ammo, attacker, weapon, bodypart ) if (attacker) then if (getElementType ( attacker ) == "player") and (getElementType ( source ) == "ped") then if (getElementData (source, "zombie") == true) then local oldZcount = getElementData ( attacker, "Zombie kills" ) if oldZcount ~= false then setElementData ( attacker, "Zombie kills", oldZcount+1 ) triggerEvent ( "onZombieWasted", source, attacker, weapon, bodypart ) else setElementData ( attacker, "Zombie kills", 1 ) triggerEvent ( "onZombieWasted", source, attacker, weapon, bodypart ) end end end end end addEventHandler("onPedWasted", resourceRoot, deanimated) this function ? Link to comment
golanu21 Posted July 31, 2013 Author Share Posted July 31, 2013 and how i do the script when i kill 3 zombies then........ give me the essential please Link to comment
Castillo Posted July 31, 2013 Share Posted July 31, 2013 addEvent ( "onZombieWasted", true ) addEventHandler ( "onZombieWasted", root, function ( killer ) local kills = getElementData ( killer, "Zombie kills" ) if ( kills == 3 ) then outputChatBox ( "You've killed 3 zombies!", killer ) end end ) 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