Hello, so I have a script that is meant to press a button to do a function. But for some reason, it isn’t working. and as soon as I playtest the game, in the output, it prints “fail”, can anyone tell me why this isn’t working?
`
local userInput = game:GetService("UserInputService")
userInput.InputBegan:Connect(function(input,gameProcessed)
if gameProcessed then -- Prevents this from running when typing in chat
if input.KeyCode == Enum.KeyCode.E then
print("success")
else
print("fail")
end
end
end)
local userInput = game:GetService("UserInputService")
userInput.InputBegan:Connect(function(input,gameProcessed)
if input.KeyCode == Enum.KeyCode.E and gameProcessed then
print("success")
else
print("fail")
end
end)