so I made a lightsaber with particles as the blade, and I want to use the button "E" to enable the particles so they show up and Then "E" to disable it as well.
you can use UserInputService to detect if the player click E and use a Bool value to see if they clicked it before it would look like this
local UserInputService = game:GetService("UserInputService") local Clicked = false UserInputService.InputBegan:Connect(function(Input) if Input.KeyCode == Enum.KeyCode.E then if Clicked then Clicked = false print("Not On") else Clicked = true print("On") --turn on --the second time people click E the click variable will be false and turn off end end end)