Question.

Posted:
Thu Aug 09, 2012 18:52
by InfinityProject
How would you inflict damage through a command? I'm stepping up from tools and blocks and what ever and moving into functions.

Posted:
Thu Aug 09, 2012 19:03
by ashenk69
Take a look in doc/lua_api that'll contain most of the things you can do with modding. The first step to cause damage is to get the player you want to cause damage to. You could get that through a proximity check, a punch event, or getting the player specifically by name. There are also other ways but those were just a few. Then from there it is easy. The player is an Object Reference and there is a function set_hp(hp) where you could simulate damage.