Question.

User avatar
InfinityProject
Member
 
Posts: 1009
Joined: Sat Mar 17, 2012 00:52

Question.

by InfinityProject » Thu Aug 09, 2012 18:52

How would you inflict damage through a command? I'm stepping up from tools and blocks and what ever and moving into functions.
 

ashenk69
Member
 
Posts: 230
Joined: Tue Jul 03, 2012 00:08

by ashenk69 » Thu Aug 09, 2012 19:03

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.
 

User avatar
InfinityProject
Member
 
Posts: 1009
Joined: Sat Mar 17, 2012 00:52

by InfinityProject » Thu Aug 09, 2012 19:48

Thanks.
 


Return to WIP Mods

Who is online

Users browsing this forum: No registered users and 9 guests