Appearance
K.Combat
Functions
K.Combat.Damage
lua
K.Combat.Damage(target: Instance, amount: number, options: { Attacker: Instance?, Type: string? }?): (boolean, number)Damages a player or NPC. Returns (landed, damageDealt).
K.Combat.Heal
lua
K.Combat.Heal(target: Instance, amount: number): (boolean, number)Heals a player or NPC, up to their MaxHealth. Returns (healed, amountHealed).
K.Combat.InBox
lua
K.Combat.InBox(cframe: CFrame, size: Vector3, ignore: Instance?): { Instance }Every living player or NPC touching the box, except ignore (a player or character).
K.Combat.InRadius
lua
K.Combat.InRadius(position: Vector3, radius: number, ignore: Instance?): { Instance }Every living player or NPC within radius studs of position, except ignore.
K.Combat.Attack
lua
K.Combat.Attack(name: string, options: { [string]: any }?)Defines an attack. Melee attacks hit a box in front of the attacker; with Projectile = { Speed, Range, Radius, Color } it fires a projectile instead.
K.Combat.Use
lua
K.Combat.Use(...: any): { Instance }?Server: Use(attacker, name, aim?) for a player or NPC. Returns the targets hit. Client: Use(name, aim?) asks the server (the attack needs Client = true).
K.Combat.OnKill
lua
K.Combat.OnKill(callback: (Instance?, Instance) -> ())Runs callback(killer, victim) when someone dies from Combat damage. killer is nil when nobody hit them recently. Both can be players or NPC models.
K.Combat.Before
lua
K.Combat.Before(operation: string, callback: (Context) -> (), priority: number?): () -> ()K.Combat.After
lua
K.Combat.After(operation: string, callback: (Context) -> ()): () -> ()K.Combat.Middleware
lua
K.Combat.Middleware(operation: string, callback: (Context, () -> ()) -> (), priority: number?): () -> ()K.Combat.Override
lua
K.Combat.Override(operation: string, callback: (Context) -> boolean?)Events
K.Combat.Killed
Server: fires with (victim, killer?) when a character that took Combat damage dies.
Generated from
src/Corode/Combat.luau.
