Kill(Player, DamageType) function
Still can't fix compilation errors, so I'm stuck to do everything in IL manually. I've been able to edit a line from encode's "Clear Inventory" function to try killing players, as shown below:
Original code was along the lines of
if(localPlayer != entity2 && entity2.isPlayer()){
entity2.controller.clearInventory();
}
Sorry about not embedding an image, it says I can't post links...
i.imgur(.)com/BQNrOX3.png
However, when going into a server and hitting the clear inventory button (which has been re-purposed to the above code), I myself get glitched out where it shows my entire "health" bar as red, my character disappears, and I cannot move. Other players do not seem to be affected.
The only reference to using this particular kill command (found in CodeHatch.Common.PlayerExtensions.Kill) is in CodeHatch.Throne.ThroneCommandHandler.Suicide, where cmd.Player.Kill(DamageType.Suicide) is called exactly how I call it (Player.Kill(DamageType)).
My other option I'm considering is
PlayerDeathEvent, though not sure how to implement that, and even less idea how to do it in IL