Shiftlock when player equips tool

  1. What do you want to achieve?
    I would like to have the player shiftlock when they equip a tool

  2. What is the issue?
    I have no idea if this is even possible

  3. What solutions have you tried so far?
    I have tried to make it so when the player presses the key to target lock a player they will also shiftlock but it just makes the target lock system not work.

Code of the target lock system just incase
local Player = game.Players.LocalPlayer
repeat wait() until Player.Character
local c = Player.Character

local mouse = Player:GetMouse()

local UIS = game:GetService("UserInputService")
local RS = game:GetService("RunService")

local Target = nil
local CamBlock ="Part", workspace.CurrentCamera)
CamBlock.Size =,1,1)
CamBlock.Transparency = 1
CamBlock.CanCollide = false
local BP ="BodyPosition", CamBlock)
BP.maxForce =,math.huge,math.huge)
BP.D = 500

	if typing then return end
	if input.KeyCode == Enum.KeyCode.Q then
		if mouse.Target and mouse.Target.Parent:findFirstChild("Humanoid") then
			Target = mouse.Target.Parent
			CamBlock.Position =, Target.PrimaryPart.Position)*,4,9).Position
			BP.Position =, Target.PrimaryPart.Position)*,4,9).Position
			Target = nil

	if Target and (c.HumanoidRootPart.Position-Target.PrimaryPart.Position).magnitude < 80 and Target.Humanoid ~= nil and Target.Humanoid.Health > 0 and c.Humanoid ~= nil and c.Humanoid.Health > 0 then 
		local CamPos =, Target.PrimaryPart.Position)*,4,9).Position
		BP.Position = CamPos
		workspace.CurrentCamera.CameraType = "Scriptable"
		workspace.CurrentCamera.CFrame =,Target.PrimaryPart.Position)
		local Dist = (c.HumanoidRootPart.Position-Target.PrimaryPart.Position).magnitude
		Target = nil
		workspace.CurrentCamera.CameraType = "Custom"

*not asking for an entire system done out for me, just how it can be done

1 Like

Hi, Making the player shiftlock is infact possible, I was looking around and this community-resources post explains in detail how to do just this.

Link to post.

I hope this helps