Im building a game where ther player might want to scope their gun(in third person) In reality all it does is squeeze their cursor when I use the Button2Down while checking if the tool was equipped it works but if shiftlock is toggled while they are scoping it adds onto the camera Offset, I was able to find the shiftlocks settings in PlayerModule > CameraModule> MouseLockController> CameraOffset. However when i try to change it through a script like this:
local PlayerModule = player.PlayerScripts:WaitForChild("PlayerModule")
local MouseController = PlayerModule:WaitForChild("CameraModule").MouseLockController
function GunModule:ToggleGunAim(bool)
scoping = bool
if bool == true then
if checkIfShiftlocked() == false then
UIS.MouseBehavior = Enum.MouseBehavior.LockCenter
humanoid.CameraOffset = Vector3.new(1.75, 0, 0)
MouseController.CameraOffset.Value = Vector3.new(0, 0, 0)
end
Aim.Bottom.Position = UDim2.new(0.5, 0, 0.5, 10)
Aim.Top.Position = UDim2.new(0.5, 0, 0.5, -10)
Aim.Right.Position = UDim2.new(0.5, 10, 0.5, 0)
Aim.Left.Position = UDim2.new(0.5, -10, 0.5, 0)
elseif bool == false then
UIS.MouseBehavior = Enum.MouseBehavior.Default
humanoid.CameraOffset = Vector3.new(1.75, 0, 0)
MouseController.CameraOffset.Value = Vector3.new(1.75, 0, 0)
Aim.Bottom.Position = UDim2.new(0.5, 0, 0.5, 18)
Aim.Top.Position = UDim2.new(0.5, 0, 0.5, -18)
Aim.Right.Position = UDim2.new(0.5, 18, 0.5, 0)
Aim.Left.Position = UDim2.new(0.5, -18, 0.5, 0)
end
end
It says it isnt a member of the module, it turns out when im looking for it it disappears but when im normally checking with no scripts its their. If anyone has an alternative way to do this, or fix this that would be well appreciated ;-;