Ahoy Everyone, I’m trying to figure out how to press the same key of an already pressed key in the userinputservice. I have a simple script right here
local UserInputService = game:GetService("UserInputService")
local player = game.Players.LocalPlayer
local emoteWheel = game.StarterGui.EmoteWheel
emoteWheel.Parent = player.PlayerGui
local animation = script.Emotes.Laugh
UserInputService.InputBegan:Connect(function(I, E)
if I.KeyCode == Enum.KeyCode.G then
emoteWheel.Enabled = true
end
end)
Hey there! I’m confused as to what you are trying to accomplish. Would you mind elaborating what functionality you are trying to make work with your UI using the key presses?
^ garlic has the correct solution you are asking for. However, I think (perhaps incorrectly) that what you are trying to do is press G to open Ui, then press G again to close it. If this is the case, you could do emoteWheel.Enabled = not emoteWheel.Enabled