Hello! So, I am trying to make a sword that will play a kill effect and I have the kill effect done. I can't figure out how to make the specific kill effect play on the player that died when someone kills them with a specific sword. I have tried to use this script:
game.Players.PlayerAdded:Connect(function(player)
player.CharacterAdded:Connect(function(Character)
local creator = Character.Humanoid:FindFirstChild("creator")
local playerkill = creator.Value
if creator ~= nil and creator.Value ~= nil then
if script.Parent.Name == "CandyCaneSword" then
require(game.ReplicatedStorage.expandingPart)(workspace.playerkill)
end
end
end)
end)
(this script is a normal script under the sword in starterpack) but nothing happens when I kill a player. If you need any scripts to help out I can provide them.

2 comments
Do you mean like a particle?
No it's not a particle. It's a candy cane that comes down on the player and many candy canes are spawned. All I have to do is require the module script and it will play, I just can't figure out how to make it so the effect plays when someone kills a player with the specific sword.