mirror of
https://github.com/PHIDIAS0303/ExpCluster.git
synced 2026-11-12 23:54:53 +09:00
Added /kill and /admin-chat
This commit is contained in:
1 parent
f1ecaff4a5
commit
d6aa2e0225
6 files changed
+48
-3
No files matched your search
@@ -0,0 +1,19 @@
|
||||
local Commands = require 'expcore.commands'
|
||||
require 'expcore.common_parse'
|
||||
|
||||
Commands.new_command('kill','Kills yourself or another player.')
|
||||
:add_param('player',true,'player-alive')
|
||||
:add_defaults{player=function(player)
|
||||
-- default is the player unless they are dead
|
||||
if player.character and player.character.health > 0 then
|
||||
return player
|
||||
end
|
||||
end}
|
||||
:add_tag('admin_only',true)
|
||||
:register(function(player,action_player,raw)
|
||||
if not action_player then
|
||||
-- can only be nil if no player given and the user is dead
|
||||
return Commands.error{'exp-commands.kill-already-dead'}
|
||||
end
|
||||
action_player.character.die()
|
||||
end)
|
||||
Reference in new issue
Block a user