joao1234 Posted March 13, 2013 Posted March 13, 2013 Hey guys! What function should i use to set the player Melee damage??
joao1234 Posted March 13, 2013 Author Posted March 13, 2013 no i want to make my fists a bit more powerfull
TAPL Posted March 13, 2013 Posted March 13, 2013 Event: "onClientPlayerDamage" or "onPlayerDamage" getElementHealth setElementHealth
joao1234 Posted March 13, 2013 Author Posted March 13, 2013 Tapl this will make whenever i attact other guys with my fists they will make more damage?
TAPL Posted March 13, 2013 Posted March 13, 2013 Whenever you attack other player, use the function getElementHealth to get the current health and then use function setElementHealth to set the health to lower, also you might need killPed when the health is low, so you will always have a killer.
Moderators IIYAMA Posted March 13, 2013 Moderators Posted March 13, 2013 LOL I am thinking back to the day I started to script. This was one of my first scrips, I don't even know if it is still working local weaponsTrue = { [0]=true,[1]=true, [2]=true, [3]=true, [4]=true, [5]=true, [6]=true, [7]=true, [8]=true, [9]=true, [10]=true, [11]=true, [12]=true, [14]=true, [15]=true } local weaponsDamage = { [0]=1,[1]=1, [2]=1, [3]=1, [4]=1, [5]=1, [6]=1, [7]=1, [8]=1, [9]=1, [10]=1, [11]=1, [12]=1, [14]=1, [15]=1 } function playerDamage ( attacker, weapon, bodypart, loss ) if weaponsTrue[weapon] then local health = getElementHealth(source) local Dloss = weaponsDamage[weapon] if health-Dloss > 0 then setElementHealth ( source, health-Dloss) else killPed(source) end end end addEventHandler ( "onPlayerDamage", getRootElement (), playerDamage ) Note: you have to edit the damage by your self.
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