I really need help with this. Im trying to make a sword fighting game where you can buy different swords with cool effects. I want to make it so that if you die by a SPECIFIC sword, theres a SPECIFIC death effect. For example, if theres a ice sword, and you die for it, you die a ice kill effect, then if theres a fire sword and you die from it, you die from a fire kill effect. Can anyone help me?
For future reference, please have an attempt on what you want to do before you ask (many people treat this as not a request site).
local Players = game:GetService('Players') local toolName = 'WeaponNameGoesHere' Players.PlayerAdded:Connect(function(Player) Player.CharacterAdded:Connect(function(Character) local Humanoid = Character:WaitForChild('Humanoid') Humanoid.Died:Connect(function() if Character:FindFirstChild(toolName) or Player.Backpack:FindFirstChild(toolName) then -- here, after said player dies is where the effect would be end -- check tool name end) -- Died end) -- CharacterAdded end) -- PlayerAdded