Hello, I am doing a Difficulty Chart obby and I added a "Press R to reset" function, but the character resets even if pressing "R" while typing in the chat.
Here's the script:
local uis = game:GetService("UserInputService")
local character = script.Parent
local reset = false
local humanoid = character:WaitForChild("Humanoid")
uis.InputBegan:Connect(function(key)
if key.KeyCode == Enum.KeyCode.R then
reset = true
humanoid.Health = 0
else
reset = false
end
end)
I would the function to only work when not in the chat, as it is annoying.

1 comment
If my below answer is helpful please mark it as answered