Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

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

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!

1 comment

0

By the way MinonJS Is a jumpscare

1 answer

✓ Accepted answer

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.

This discussion is preserved as it was. New answers, comments, and votes are closed.