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.
COMMUNITY QUESTION
does anybody know how to show particle when press button E and disable when press button E?
1 answer
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)
2 comments
0
i put this script on the tool?
0
put this in a local script
This discussion is preserved as it was. New answers, comments, and votes are closed.

1 comment
pls someone tell me