Hello,
I am trying to make it so that the player presses ‘T’ or ‘ButtonL2’ to get the function running but it registers the user input 2 times and I don’t know whats causing the issue. It should only be registering the input once like normal.
UIS.InputBegan:Connect(function(input,gp)
if gp == false then
if input.UserInputType == Enum.UserInputType.Keyboard then
if input.KeyCode == Enum.KeyCode.T and d == 0 then
warn(input.KeyCode) -- prints the output below
d = 1
updateOrChange("change")
wait()
d = 0
end
elseif input.UserInputType == Enum.UserInputType.Gamepad1 then
if input.KeyCode == Enum.KeyCode.ButtonL2 then
updateOrChange("change")
d = 1
wait()
d = 0
end
end
end
end)
Here is the output (notice the highlighted times, meaning it registered 2 times which only should be registered once):
Anyway, how do I fix the issue