I created a sword trail which is attached, and I am wondering how to make it optional to have the sword trail in the game. I want everyone to see whether a person has it on or not
COMMUNITY QUESTION
How do I make something visible/invisible when a letter is pressed?
1 answer
Here's a sample that you could work with:
-- LocalScript
local part = workspace:WaitForChild("Baseplate")
local key = Enum.KeyCode.H -- Press H to toggle visibility of part value
game:GetService("UserInputService").InputEnded:Connect(function(input, typing)
if not typing and input.UserInputType == Enum.UserInputType.Keyboard then
if input.KeyCode == key and part then
if part.Transparency == 1 then
part.Transparency = 0
else
part.Transparency = 1
end
end
end
end)
This discussion is preserved as it was. New answers, comments, and votes are closed.

5 comments
A) User input locally. B) RemoteEvents/Functions.
How are the scripts supposed to look like?
If you had shown code, I would have helped you out a bit more. I'll give you some links instead.
https://developer.roblox.com/en-us/api-reference/class/UserInputService
https://developer.roblox.com/en-us/articles/Remote-Functions-and-Events