Jump to content

custom damage handler


kaos057

Recommended Posts

Posted

I am trying to make a full MMO with levels, custom armor/weapons, etc. To do this I need to disable default damage and handle it myself in order to take into consideration extra hitpoints and damage modifiers from the custom gear. I know I can disable the damage on client side using onClientPlayerDamage which works for any self inflicted damage but the server side still does damage.

So is there any way to either stop all damage completely or somehow make a player have more hitpoints than others?

Posted

Yes I know that. My question was how to do that if its possible. You cant cancel the server sided damage event as far as i know. So is there any other way to completely cancel damage on server side?

Posted (edited)

To delete player damage use:

addEventHandler ( "onClientPlayerDamage", getLocalPlayer(), cancelEvent )  

To make another damage , you can try this:

setElementHealth ( source, getElementHealth(source) - 20 )  

-- Example

///EDIT

Oh.. someone write this first : |

Edited by Guest
Posted

You can anyways use triggers from server side and vice versa if your scripts won't work without this.

triggerClientEvent 
triggerServerEvent 

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...