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?
COMMUNITY QUESTION
How do I make a kill effect, that only happens if you die by a SPECIFIC weapon?
1 answer
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
This discussion is preserved as it was. New answers, comments, and votes are closed.

7 comments
Ok sorry I wont do it next time, but I want it so that a specific death effect happens when you die form a specific sword
Edited, sorry I didn't see that part.
Thx, it works, you're a life saver
No worries.
Also for the here after said the player dies is where the effect would be, do I jsut put in the script for the death effect?
Yes, just put the effect code just where it says 'after said player dies...'
ok thank you