Hello! I am here asking for some assistance (like you’ve read in the title) on a system I have been working on (image attached).
Once you press any key of your choice, I want this UI to fade out and a new UI fades in, if you have any ideas please feel free to send a message, otherwise have a nice day.
local UIS = game:GetService("UserInputService")
UIS.InputBegan:Connect(function(key)
if key.UserInputType == Enum.UserInputType.Keyboard then
--pressed key
end
end)
You would also have to check GameProcessedEvent if you dont want it to start when you are chatting.
local UIS = game:GetService("UserInputService")
UIS.InputBegan:Connect(function(key,gpe)
if key.UserInputType == Enum.UserInputType.Keyboard and not processed then
--pressed key
end
end)
local UIS = game:GetService("UserInputService")
local keys = Enum.Keycode:GetEnumItems()
local inputConn
inputConn = UIS.InputBegan:Connect(function(input, typing)
if not typing then -- You can change this.
if table.find(keys, input.KeyCode) then
-- Stuff
inputConn:Disconnect() -- Makes it so this event stops firing.
end
end
end)
you would check for any input. I would also add it to a connection and disconnect it later so it doesn’t keep firing
local UIS = game:GetService("UserInputService")
local connection = nil
connection = UIS.InputBegan:Connect(function(input, gpe)
if gpe then return end
--- do stuff
connection:Disconnect()
connection = nil
end)
I’m not talking about yours. yours should work perfectly as well except it will keep firing.
edit: i see you just edited it. so it should do the exact same thing as mine