How Do I Make A Key Bind Changing System?

So I’m Trying To Make A Key Bind Changing System For My Game But, I Got No Idea How To.
So I Need You Guys’s Opinion That How Can I Make It,
I Don’t Need Any Scripts, I Just Need Ideas That How Can I Make It.

Thank You For The Help :smiley:

1 Like

Use UserInput service to tell what key bind the player has used.

2 Likes

I Know UserInputService, But Like How Do I See That What Key The Player Pressed?

Multiple If Statements?

1 Like

As shown on the developer hub page, you can read the KeyCode value of the InputObject, to figure out what key a user is pressing.

local function onInputBegan(input, gameProcessed)
	if input.KeyCode = Enum.KeyCode.F then
		--the F key has been pressed
	end

    if input.KeyCode = Enum.KeyCode.LeftShift then
		--the left Shift key has been pressed
	end
end
 
UserInputService.InputBegan:Connect(onInputBegan)

If you would rather bind specific actions to a function, instead of filtering all input with .InputBegan, you can alternatively use ContextActionService.

2 Likes

Thank You Very Much Got It Now!