I was trying to make a advanced stamina gui. but I stumbled into a problem that was weird
If I were to press Q, it should print out “hi”, but it didn’t work.
But if I changed the Keycode to LeftShift, it would work and print out “hi”
local uis = game:GetService("UserInputService")
local plr = game.Players.LocalPlayer
local gui = plr.PlayerGui:WaitForChild("Stamina")
local character = plr.Character
local tool = plr.Backpack.Sword
local dashPower
local power
local debounce = false
local canslide = true
local keybind = Enum.KeyCode.Q
uis.InputBegan:Connect(function(input,gameprocessed)
if gameprocessed then return end
if tool:IsDescendantOf(character) and canslide == true then
canslide = false
if input.KeyCode == keybind then
print("Hi")
end
canslide = true
end
end)
Hello,
I just tested your script in a new baseplate and it worked perfectly fine.
Is there any more context you can add to your situation which could help us help you fix your problem?
I’m sorry, I have no idea what the issue might be.
Your script is solid from what I can tell, there’s no real reason why it would work with one keybind and not the other.
I again apologize and hope someone else might be able to assist you.