Insert me ranting about CreatorTags for 50 hours
CreatorTags! They’re basically used to simply detect a “kill check”, & they can reference both the “Target”, and the “Killer”
“But wait, how do I use them?”
Well, the way they’re implemented is that when a Tool kills a player, something what’s called a “CreatorTag” is added inside the Character’s Humanoid
So say we add this script inside ServerScriptService
:
game.Players.PlayerAdded:Connect(function(Player)
Player.CharacterAdded:Connect(function(Character)
local Humanoid = Character:WaitForChild("Humanoid")
Humanoid.Died:Connect(function()
local KillerTool = nil
local Creator = Humanoid:FindFirstChild("creator")
if Creator and Creator.Value then
local Killer = Creator.Value
for _, Tool in pairs(Killer:GetChildren()) do
if Tool:IsA("Tool") then
KillerTool = Tool
end
end
end
end)
end)
end)
Inside our Humanoid.Died
event, we can check if there’s a Creator
object inside the Target’s Humanoid & if it is, we can define the killer & check what tool he used >:O
Lastly, we can use is potentially a RemoteEvent
(Depending on how you want to use it), and we can choose from a variety of different options on how we want to send the Kill Feed:
-
We can send it to the Target that died
-
We can send it to the Killer
-
We can send it for all Players that are currently in the game
It could be implemented as something along the lines of this if we wanted to send it to the Target:
RemoteEvent:FireClient(Player, Killer, KillerTool)
But this is just an example on how you could potentially implement it