Hello!
I’ve been making a script, (Keep in mind, theres no bugs with the actual script.)
and I’m making it so when you press a certain button, it fires a server that makes an accessories handle transparent / visible.
Heres my script.
local PlayerWithSword = {"name", "name"}
local player = game.Players.LocalPlayer
repeat wait() until player.Character.Humanoid
local ShowKatanaEvent = game.ReplicatedStorage:WaitForChild("ShowKatana")
local humanoid = player.Character.Humanoid
local mouse = player:GetMouse()
local character = player.Character
Cooldown = false
mouse.KeyDown:connect(function(key)
if key == "h" then
if not Cooldown then
Cooldown = true
ShowKatanaEvent:FireServer()
wait(0.1)
Cooldown = false
end
end
end)
Now, I was wondering how I could make it so when the key “h” is pressed a second time, it “unequips” (making it transparent) the handle.
What I want is for when H is pressed the first time, it makes the handle visible. If it’s pressed a second time, it makes the handle invisible, and so on…
Any help is appreciated!