mirror of
https://github.com/PHIDIAS0303/ExpCluster.git
synced 2025-12-27 11:35:22 +09:00
.
This commit is contained in:
@@ -20,11 +20,10 @@ 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
|
||||
local pos = other_player.position
|
||||
other_player.surface.create_entity{ name = "lightning", position = { pos.x, pos.y - 16 }, target = other_player.character }
|
||||
other_player.character.die()
|
||||
else
|
||||
return Commands.status.unauthorised{ "exp-commands_kill.lower-role" }
|
||||
|
||||
Reference in New Issue
Block a user