From 7adf4a4477ed0c80db3c10023e437077ef3b4d33 Mon Sep 17 00:00:00 2001 From: PHIDIAS Date: Tue, 4 Feb 2025 06:36:40 +0900 Subject: [PATCH] Add Kill Effect (#366) * Update kill.lua * Update kill.lua * Update kill.lua --- exp_scenario/module/commands/kill.lua | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/exp_scenario/module/commands/kill.lua b/exp_scenario/module/commands/kill.lua index 2ab239bd..ac4356d0 100644 --- a/exp_scenario/module/commands/kill.lua +++ b/exp_scenario/module/commands/kill.lua @@ -20,11 +20,11 @@ Commands.new("kill", { "exp-commands_kill.description" }) if other_player == nil then -- Can only be nil if the target is the player and they are already dead return Commands.status.error{ "exp-commands_kill.already-dead" } - elseif other_player == player then - -- You can always kill yourself - other_player.character.die() - elseif highest_role(other_player).index < highest_role(player).index then - -- Can kill lower role players + elseif (other_player == player) or (highest_role(other_player).index < highest_role(player).index) then + -- You can always kill yourself or can kill lower role players + if script.active_mods["space-age"] then + other_player.surface.create_entity{ name = "lightning", position = { other_player.position.x, other_player.position.y - 16 }, target = other_player.character } + end other_player.character.die() else return Commands.status.unauthorised{ "exp-commands_kill.lower-role" }