function MouseLockController.OnMouseLockToggled(m)m.isMouseLocked=not m.isMouseLocked if m.isMouseLocked then local S=script:FindFirstChild("\067\117\114\115\111\114\073\109\097\103\101")if S and(S:IsA("\083\116\114\105\110\103\086\097\108\117\101")and S.Value)then m.savedMouseCursor=Mouse.Icon Mouse.Icon=S.Value else if S then S:Destroy()end S=Instance.new("\083\116\114\105\110\103\086\097\108\117\101")S.Name="\067\117\114\115\111\114\073\109\097\103\101"S.Value=DEFAULT_MOUSE_LOCK_CURSOR S.Parent=script m.savedMouseCursor=Mouse.Icon Mouse.Icon=DEFAULT_MOUSE_LOCK_CURSOR end else if m.savedMouseCursor then Mouse.Icon=m.savedMouseCursor m.savedMouseCursor=nil end end m.mouseLockToggledEvent:Fire()end
--[[ Local Functions ]]
--
function MouseLockController:OnMouseLockToggled()
	self.isMouseLocked = not self.isMouseLocked

	if self.isMouseLocked then
		local cursorImageValueObj = script:FindFirstChild("CursorImage")
		if cursorImageValueObj and cursorImageValueObj:IsA("StringValue") and cursorImageValueObj.Value then
			self.savedMouseCursor = Mouse.Icon
			Mouse.Icon = cursorImageValueObj.Value
		else
			if cursorImageValueObj then
				cursorImageValueObj:Destroy()
			end
			cursorImageValueObj = Instance.new("StringValue")
			cursorImageValueObj.Name = "CursorImage"
			cursorImageValueObj.Value = DEFAULT_MOUSE_LOCK_CURSOR
			cursorImageValueObj.Parent = script
			self.savedMouseCursor = Mouse.Icon
			Mouse.Icon = DEFAULT_MOUSE_LOCK_CURSOR
		end
	else
		if self.savedMouseCursor then
			Mouse.Icon = self.savedMouseCursor
			self.savedMouseCursor = nil
		end
	end

	self.mouseLockToggledEvent:Fire()
end
