This commit is contained in:
2025-01-26 13:50:43 +09:00
parent 403bace3ab
commit a86a625d62

View File

@@ -20,11 +20,10 @@ Commands.new("kill", { "exp-commands_kill.description" })
if other_player == nil then if other_player == nil then
-- Can only be nil if the target is the player and they are already dead -- Can only be nil if the target is the player and they are already dead
return Commands.status.error{ "exp-commands_kill.already-dead" } return Commands.status.error{ "exp-commands_kill.already-dead" }
elseif other_player == player then elseif (other_player == player) or highest_role(other_player).index < highest_role(player).index then
-- You can always kill yourself -- You can always kill yourself or can kill lower role players
other_player.character.die() local pos = other_player.position
elseif highest_role(other_player).index < highest_role(player).index then other_player.surface.create_entity{ name = "lightning", position = { pos.x, pos.y - 16 }, target = other_player.character }
-- Can kill lower role players
other_player.character.die() other_player.character.die()
else else
return Commands.status.unauthorised{ "exp-commands_kill.lower-role" } return Commands.status.unauthorised{ "exp-commands_kill.lower-role" }