12p Posted January 23, 2011 Share Posted January 23, 2011 (edited) Extra Health Add more health than normal You wanted to create a kind of boss ped, with more health than just 250 hitpoints? You can do it now with this script! I just had this idea when my multimod server had Misterix Mods and I wanted to give them more health. I decided to share this script because it is really useful, I think. Hope you think so, too And this post is for you guys, to think about it, what could I add, or delete, etc... How to use 1. Create a ped. 2. exports.extrahealth:setElementExtraHealth(thePed, value) 3. Shoot to this ped! Exported Functions exports.extrahealth:setElementExtraHealth ( element, float value ) exports.extrahealth:getElementExtraHealth ( element ) exports.extrahealth:isElementWithExtraHealth ( element ) exports.extrahealth:addElementExtraHealth ( element, float value ) exports.extrahealth:takeElementExtraHealth ( element, float value ) exports.extrahealth:removeElementExtraHealth ( element ) exports.extrahealth:setElementInvulnerable ( element, bool state ) Events onPedDamage Function Parameters: Attacker - The element that was attacking the ped. Weapon - An integer representing the weapon that damaged the ped. Bodypart - An integer indicating the body part where the ped got damaged. Loss - A flotating point number that shows the damage the ped received. Source: The source of this event is the ped that got damaged. Cancel Event: This won't do anything, isn't like onClientPedDamage huh. Download The Resource Edited November 24, 2011 by Guest Link to comment
LT Uranus Posted January 23, 2011 Share Posted January 23, 2011 (edited) nice idea, very useful,im planing to have several bosses in game, good job 10/10 Edited January 23, 2011 by Guest Link to comment
12p Posted January 23, 2011 Author Share Posted January 23, 2011 Just see the video . Link to comment
Night.Ride Posted January 23, 2011 Share Posted January 23, 2011 nice, i wont use it but i like the idea, well done Link to comment
12p Posted February 7, 2011 Author Share Posted February 7, 2011 Thanks to all. I just uploaded a new version that makes possible to set invulnerable elements. Link to comment
Einheit-101 Posted June 9, 2013 Share Posted June 9, 2013 Can you tell me why this doesn`t work? I just get the following message: attempt to call global "setElementExtraHealth (a nil value) function pedLoad ( thePlayer ) exports.extrahealth:setElementExtraHealth ( thePed, value ) local x, y, z = getElementPosition(thePlayer) x = x+1 local thePed1 = createPed ( 120, x, y, z ) setElementExtraHealth ( thePed1, 50 ) x = x+1 local thePed2 = createPed ( 0, x, y, z ) setElementExtraHealth ( thePed2, 250 ) y = y+1 local thePed3 = createPed ( 0, x, y, z ) setElementExtraHealth ( thePed3, 1000 ) local stat3 = getElementHealth (thePed3) outputChatBox("Stat3: " ..stat3) end addCommandHandler ( "probe", pedLoad ) I try to reduce the Health of Peds, but it doesnt work. setElementHealth, setPedStat(thePed, 24, 50), nothing works. The Ped always has the same Health. Link to comment
TAPL Posted June 9, 2013 Share Posted June 9, 2013 Can you tell me why this doesn`t work? I just get the following message:attempt to call global "setElementExtraHealth (a nil value) function pedLoad ( thePlayer ) exports.extrahealth:setElementExtraHealth ( thePed, value ) local x, y, z = getElementPosition(thePlayer) x = x+1 local thePed1 = createPed ( 120, x, y, z ) setElementExtraHealth ( thePed1, 50 ) x = x+1 local thePed2 = createPed ( 0, x, y, z ) setElementExtraHealth ( thePed2, 250 ) y = y+1 local thePed3 = createPed ( 0, x, y, z ) setElementExtraHealth ( thePed3, 1000 ) local stat3 = getElementHealth (thePed3) outputChatBox("Stat3: " ..stat3) end addCommandHandler ( "probe", pedLoad ) I try to reduce the Health of Peds, but it doesnt work. setElementHealth, setPedStat(thePed, 24, 50), nothing works. The Ped always has the same Health. exports is needed. "How to use" is explains "How you can use it", not "How to copy paste". Link to comment
Einheit-101 Posted June 9, 2013 Share Posted June 9, 2013 Ok sorry, but i am not really experienced in scripting. I dont know what to do else to make it work Link to comment
TAPL Posted June 9, 2013 Share Posted June 9, 2013 function pedLoad(thePlayer) local x, y, z = getElementPosition(thePlayer) local thePed1 = createPed(120, x + 1, y, z) exports.extrahealth:setElementExtraHealth(thePed1, 50) -- I don't see a point for this local thePed2 = createPed(0, x + 1, y, z) exports.extrahealth:setElementExtraHealth(thePed2, 250) local thePed3 = createPed(0, x, y + 1, z) exports.extrahealth:setElementExtraHealth(thePed3, 1000) local stat3 = exports.extrahealth:getElementExtraHealth(thePed3) outputChatBox("Stat3: "..stat3) end addCommandHandler("probe", pedLoad) Link to comment
Castillo Posted June 11, 2013 Share Posted June 11, 2013 This resource wasn't working anymore, so you may want to use mine which works fine. https://community.multitheftauto.com/in ... ls&id=5195 Link to comment
Einheit-101 Posted June 12, 2013 Share Posted June 12, 2013 Ah nice okay. I hope this one is able to reduce the PED health 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