Hello, I am trying to make a reloading event for my gun, but Enum.Keycode just isn’t working at all when I suppose it should work. There are no errors on the output. I legitimately have no clue about what is happening.
I have searched for similar threads and found many, but none solved my issue.
Here is part of the code I am using:
local uis = game:GetService("UserInputService")
uis.InputBegan:Connect(function(input, gameProcessed)
if input.UserInputType == Enum.UserInputType.MouseButton1 and Humanoid.Health >= 1 and Tool.Parent == Character and canfire then
events.Firing:FireServer()
print("shooting")
elseif input.UserInputType == Enum.KeyCode.R and Humanoid.Health >= 1 and Tool.Parent == Character and canfire then
events.Reload:FireServer()
print("reloading!")
end
end)
I hope this can be solved.