Hello! I am working on swords that are planned to have the functionality of above, and I cannot seem to get it to work, could any one of you extremely helpful people provide an answer? Thank you!
✓ ANSWER ACCEPTED
How do I make a sword have fire surround the blade when I press E and dissapear when pressed again?
1 answer
✓ Accepted answer
You can make a bool variable inside the Tool's LocalScript and then use UserInputService to make it when the key is pressed.
The bool variable should be like this:
local boolvar = false -- or true
Here is a example:
-- LocalScript inside the tool
local tool = script.Parent
local enabled = false -- or true
local uis = game:GetService('UserInputService')
tool.Equipped:Connect(function()
uis.InputBegan:Connect(function(input)
if input.KeyCode == Enum.KeyCode.E and not enabled then
enabled = true -- Set to true when player pressed E
-- Add Fire
elseif enabled then
enabled = false
-- Remove Fire
end
end)
end)
This discussion is preserved as it was. New answers, comments, and votes are closed.

1 comment
^ Does not work, I am pretty sure it is something wrong with my add fire script..