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!
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)