IsCapLockEnabled

does it exist?
would help if you use caps lock to toggle running or walking

with ContextActionService to use Caps Lock to toggle walk and run. when caps lock pressed it toggles the players running or walking.

if IsCopsLockEnabled then Run else Walk

4 Likes

You can create a variable called isCapsLockEnabled and using UserInputService, you can update the value with the InputBegan and InputEnded events. Then in your function that handles the walk/run mode, check if isCapsLockEnabled is true.

local UserInputService = game:GetService('UserInputService')

local isCapsLockEnabled = false

UserInputService.InputBegan:Connect(function(inputObject)
	if inputObject.KeyCode == Enum.KeyCode.CapsLock then
		isCapsLockEnabled = true
	end
end)

UserInputService.InputEnded:Connect(function(inputObject)
	if inputObject.KeyCode == Enum.KeyCode.CapsLock then
		isCapsLockEnabled = false
	end
end)
1 Like

this will fire when the player joins? more looking to squash the problem with the player joining w/ caps lock already on

1 Like

Unfortunately, there isn’t anything built in to check if caps lock is active.

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.