I’m guessing it’s to do with setting the mouse behavior here:
game:GetService("RunService").RenderStepped:Connect(function()
if not Check() then
return
end
if SettingsAutomatic and Check() then
if Button1Down and not DBShoot then
Fire()
end
end
local MouseBehavior = Enum.MouseBehavior.Default
if Humanoid.CameraOffset.Magnitude>0 then
MouseBehavior = Enum.MouseBehavior.LockCenter
end
if Shiftlock then
local hrp = Character.HumanoidRootPart
local dir = Camera.CFrame.LookVector*1000
Character.HumanoidRootPart.CFrame = CFrame.lookAt(hrp.Position,Vector3.new(dir.X,hrp.Position.Y,dir.Z))
end
local o = Player.PlayerScripts.Viewmodel.Offset0
o.Value=aimoffset.Value
Camera.FieldOfView=FoV.Value
if Character:FindFirstChild("Head").LocalTransparencyModifier >= 1 then
FirstPerson = true
else
FirstPerson = false
end
if Shiftlock and not FirstPerson then
MouseBehavior = Enum.MouseBehavior.LockCenter
Humanoid.CameraOffset = Vector3.new(2,1,0)
elseif not Shiftlock then
Humanoid.CameraOffset = Vector3.new(0,0,0)
end
if FirstPerson then
MouseBehavior = Enum.MouseBehavior.LockCenter
Humanoid.CameraOffset = Vector3.new(0,0,0)
end
if UIS.MouseBehavior~=MouseBehavior then
UIS.MouseBehavior = MouseBehavior
end
end)
I’m not sure how to fix this though, considering I kinda of need it for shiftlock system.