Custom Shift Lock Module - [New]

:wave: Hey! I have noticed that many programmers have been wishing for a way to apply shift lock easily.
So, I have created a simple Custom Shift Lock Module. The module’s API is straightforward and simple, here is an example of how you would use it:

local shiftLock = (require(script.Parent:WaitForChild("ShiftLock")))
local userInputService = (game:GetService("UserInputService"));

function input_Began(input, gpe)
	if (gpe) then return end;
	if (input.KeyCode == Enum.KeyCode.LeftShift) then
		shiftLock:Lock(not shiftLock:IsLocked())
	end;
end;

userInputService.InputBegan:Connect(input_Began)
-- Roblox's shift lock behavior, you press Left Shift, and it locks / unlocks dependent on the current state.

:gear: There are also custom settings which you can apply at the beginning of the module:

local shiftLock = {
	-- Settings (i.e Customizations):
	Settings = {
		CameraOffsetX = (2);
		CameraOffsetY = (1.75);
		MouseIconOnToggle = ("");
		CameraOffsetLerpSpeed = (3);
		CharacterFacingLerpSpeed = (3);
	}
}

:page_facing_up: Current API document:

--[[
    ShiftLock:Lock(boolean) --> Locks/Unlocks the shift lock, returns: {nil}
    ShiftLock:IsLocked() --> Returns {boolean}
--]]

:fist: Grab the module here, you don’t have to credit me:

Make sure to recommend for new settings i.e new APIs, any idea is good!
:stop_sign: Note: This is a new module, some glitches might occur, make sure to report them.

8 Likes

:stop_sign: Found out a major bug I didn’t notice while testing, I am working to fix it.

:green_circle: After some work that has been done, the bug has been fixed, and model is now copy-open again.

2 Likes

This is a crazy good module I love this! Thank you! One suggestion, Allow the player to offset the camera for example in settings maybe add a setting call xoffset and another for yoffset. Just a little thing that will help other people get a better camera.

1 Like

Thanks for the suggestion, and I apologize for the very-late response.
I will consider adding the feature that you suggested, as I do see it being useful :+1: :pray:
Edit: I have just tested and added this feature, thanks for your suggestion!

kinda looks buggy when you move your camera fast Screen capture - a639071dd895abb35c03e09542efa026 - Gyazo