Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How Do I make a script detect if a player isn't pushing a keyboard button?

Asked by 3 years ago

Hello! I need help with Coding! like usual.

uis.InputBegan:Connect(function(input,GameProccesedEvent)


if not input.KeyCode == Enum.KeyCode.F then
    game.Workspace.MinonJS.Transparency = 0
    print("This worked lol")
end 

This is the code, I am a stupid developer and don't know how to do this :( I would love if you guys could help me! Thank you!

0
By the way MinonJS Is a jumpscare YoungsterJeremy1 6 — 3y

1 answer

Log in to vote
0
Answered by
SuperPuiu 497 Moderation Voter
3 years ago
Edited 3 years ago

You can use InputEnded from UserInputService. To detect if a button is still pushed you can try:

local UIS = game:GetService("UserInputService")
local isPushed = false

UIS.InputBegan:Connect(function() -- if any input begins, it will detect that
isPushed = true
end)

UIS.InputEnded:Connect(function() -- If any input ends, it will detect that.
isPushed = false
end)

This is just an example, by what I understood from the title.

Ad

Answer this question