How to make a glory kill?

Hi!

I’m trying to make a DBNO/Down system like in Criminality and i have no idea how to make it.

I want it so each weapon has a unique glory kill.

There should also be a specific button to press, like F to finish off a player.

Like this.

Also i will be using The FE melee kit (2021).

Please help me. I wanted to add this feature for so long i could not find any tutorials so this is my last chance. So please help me.

Thnaks~

4 Likes

If you want something like that you will most likely have to

  1. Figure out how to make it on your own
    or
  2. Pay a dev to create and implement it for you

I tried finding some tutorials or / a premade pack. No dice

Good luck!

1 Like

This might seem like a daunting task at first, but let’s go over the steps to do it!

  • Track the item the player is using, in what way is up to you.
  • Track which enemy is being killed.
    • This can be done through tracking the mouse position or checking who damaged them
  • Track when the proper key is pressed (F in this case)
  • Play the animation and damage the player!

Hope this helped.

4 Likes

I made something like this a while back for the fun of it. Basically;

  • Have a remote event that fires when the key bind is pressed
  • Have a script that listens for that event, and checks for nearby players that have an attribute, i.e. “knocked_down”
  • Have a module script in the weapon with a function that the previous script will run when a target is found

Here’s an example;

--Server script
local Players = game:GetService("Players");
local ReplicatedStorage = game:GetService("ReplicatedStorage");
local executeEvent = ReplicatedStorage.Execute; --Name this whatever, execute is just what I used at the time

function getNearestPlayer(executingChar)
	local maxDist = 15; --This is the radius that you can execute someone.
	local target;
	for _, plr in next, Players:GetPlayers() do
		local char = plr.Character;
		local hum = char:FindFirstChildOfClass("Humanoid");
		local dist = (executingChar.PrimaryPart.Position - char.PrimaryPart.Position).Magnitude;
		if hum.Health > 0 and char:GetAttribute("knocked_down") and dist < maxDist then
			--Make sure the target's alive, has the knocked_down attribute, and is close enough.
			maxDist = dist;
			target = char;
		end
	end
	return target;
end

function onExecuteRequest(plr)
	local char = plr.Character;
	local hum = char:FindFirstChildOfClass("Humanoid");
	local weapon = char:FindFirstChildOfClass("Tool");

	local target = getNearestPlayer(plr);
	if target and hum.Health > 0 and weapon then
		local config = require(weapon:FindFirstChild("Config"));
		if config and config.execute then --Checks for a config, and if it has an execute function
			config.execute(char, target);
		end
	end
end

executeEvent.OnServerEvent:Connect(onExecuteRequest);
--Module script
local tool = script.Parent;
local executeAnim = tool.execute_anim_here;

local Config = {};

function Config.execute(user, target)
	local userHum = user:FindFirstChildOfClass("Humanoid");
	local targetHum = user:FindFirstChildOfClass("Humanoid");
	
	local animTrack = userHum:LoadAnimation(executeAnim);
	animTrack:Play();
	
	wait(1); --This is just a delay to let the animation play, you could also use animTrack.KeyframeReached
	
	targetHum.Health = 0;
end

return Config;
4 Likes

You didn’t even give him any ideas on how to make it himself. No code, no inspiration, not even a direction to go in, you kinda just said ‘make it yourself, good luck bro’

10 Likes

Not any help dude. Please only post if you can help me.

1 Like

Also that was pretty good advice

1 Like

I would reccomend having a downed bool value in the Humanoid, and once you press F send a raycast downwards to see if it hits a player, if the player is considered down, play the animation and the finish

1 Like

The advice that people are giving you is very good, tell me how it went. I went along with what they said, made it in my own way, and came up with this.

1 Like

Hey, thanks for telling me, but this was posted almost a year ago, and i probably won’t make a glory kill system, but thanks for the help.

2 Likes