1 | script.Parent.Equipped:Connect ( function (key) |
2 | if (key = = "F" ) then |
3 | script.Parent.Part 1111. Transparency = 0 |
4 | script.Parent.Part 11111. Transparency = 0 |
5 | end |
6 | end ) |
Equipped doesn't have a "key" value, but it has a "mouse" value which can be used to get keyboard input.
1 | local tool = script.Parent |
2 | tool.Equipped:connect( function (mouse) -- indexing mouse from tool.equipped |
3 | mouse.KeyDown:connect( function (key) --connecting keydown from the mouse already indexed |
4 | if key = = "f" then script.Parent.Part 1111. Transparency = 0 |
5 | script.Parent.Part 11111. Transparency = 0 |
6 | end |
7 | end ) |
8 | end ) |
Here's a script that you can hide the saber with: (hope it works)
local tool = script.Parent tool.Equipped:connect(function(mouse) -- indexing mouse from tool.equipped mouse.KeyDown:connect(function(key) --connecting keydown from the mouse already indexed if key == "q" then if script.Parent.Part1111.Transparency == 0 and script.Parent.Part11111.Transparency == 0 then wait (0.5) script.Parent.Part1111.Transparency == 1 script.Parent.Part11111.Transparency == 1
1 | end |
end) end)