While this is kind of a necro post I'll work on something like this as I would probably want one on my own server and post it here when I'm done. Not sure if I'll do exactly what you're wanting I'll probably do something extremely similar, and you're welcome to tweak it as you see fit.
Edit: I wrote something up and I'll test it a bit later, then upload the code to this post if it works right.
2nd Edit: Can't get it to work, but here's the code I've done so far. Maybe somebody else can explain why it's not showing up in my commands list.
Code:
-- Created by NoahtheBoah36 ([email protected])
-- Permission to redistribute/use/modify is granted, provided credit is given to the developer.
local COMMAND = Clockwork.command:New("GetHit");
COMMAND.tip = "Randomly determine where a target is hit on their body.";
COMMAND.flags = CMD_DEFAULT;
-- Called when the command has been run.
function COMMAND:OnRun(player, arguments)
local randomizer = math.random(1, 20);
if randomizer == 1
Clockwork.chatBox:AddInTargetRadius(player, "it", "The target is hit in the head!", player:GetPos(), Clockwork.config:Get("talk_radius"):Get() * 2);
elseif randomizer <= 6
Clockwork.chatBox:AddInTargetRadius(player, "it", "The target is hit in the chest!", player:GetPos(), Clockwork.config:Get("talk_radius"):Get() * 2);
elseif randomizer <= 12
Clockwork.chatBox:AddInTargetRadius(player, "it", "The target is hit in the abdomen!", player:GetPos(), Clockwork.config:Get("talk_radius"):Get() * 2);
elseif randomizer <= 15
Clockwork.chatBox:AddInTargetRadius(player, "it", "The target is hit in the shoulder!", player:GetPos(), Clockwork.config:Get("talk_radius"):Get() * 2);
elseif randomizer <= 17
Clockwork.chatBox:AddInTargetRadius(player, "it", "The target is hit in the arm!", player:GetPos(), Clockwork.config:Get("talk_radius"):Get() * 2);
elseif randomizer <= 19
Clockwork.chatBox:AddInTargetRadius(player, "it", "The target is hit in the leg!", player:GetPos(), Clockwork.config:Get("talk_radius"):Get() * 2);
else
Clockwork.chatBox:AddInTargetRadius(player, "it", "The target is miraculously missed!", player:GetPos(), Clockwork.config:Get("talk_radius"):Get() * 2);
end;
end;
COMMAND:Register();