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.